Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ workshop/.hugo_build.lock
obj/
cdk.out/
*~
**/.vscode/**
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"biomejs.biome"
]
}
133 changes: 129 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,132 @@
## Introduction to the AWS Cloud Development Kit (CDK) - Workshop
## Introduction to TerraConstructs - Workshop

This workshop has been retired. Please refer to the
This workshop is a fork of the
[AWS CDK Immersion Day Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/10141411-0192-4021-afa8-2436f3c66bd8/en-US)
for the latest content.

The content is archived here for reference.
## Developer Guide

This workshop is built with markdown as a static HTML site using [hugo](http://gohugo.io).

### Installing Hugo

Because we use asset pipelines and some integrity stamping techniques, we need the "extended" edition.
(This is the recommended version by Hugo themselves, but it's worth pointing out.)

Use [mise](https://mise.jdx.dev/getting-started.html) to get started.

```bash
$ mise install
```

There are [installation instructions](https://gohugo.io/installation/) available from the Hugo documentation,
however the short form is "Download the latest extended version from [the releases page](https://github.com/gohugoio/hugo/releases/latest) and put the
binary in your PATH somewhere".

All else fails, follow the installation instructions. As long as you have the Extended hugo release, it's all good.

### Theme

This is built off the [Hugo-Book](https://github.com/alex-shpak/hugo-book) theme, lightly modified to suit our needs.
A point of note is that this *Should* eventually be moved to a git submodule, but there's changes that need to be upstreamed.

Notably:

* Upstream does not use any [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) checking. This is done out of paranoia
* Upstream still has a small handful of inline styles (which I've worked hard to remove)

### Building locally

You'll find the content of the workshop in the [workshop/](workshop/) directory.

You can start up a local development server by running:

```bash
$ cd workshop
$ hugo serve
```

open http://localhost:1313/ and you'll have the workshop as it stands.

### Adding translations & localization.

Adding a translation means

* Copying the content from `workshop/content/en/` into your own directory (`workshop/content/xx`)
* Translating the content
* Adding a configuration for your language in `workshop/config.toml`
* Adding a translation file for all appropriate legal terms in the `workshop/i18n/xx.yml` file, copied from `en.yml`

**The last part is important**! We need to have a translation for

* "Privacy", "Site Terms"

And we *Should* have a translation for

* The cookie banner message
* the cookie banner *actions*.

These will fall back to the English ones (such as in the JP one) and the link will go to the appropriate-enough regional terms and privacy pages.

**If your language needs special fonts** in order to render correctly, you should add them in the localization file.
For example, the Japanese localization uses Noto Sans JP to
make sure that the typography looks good, as well as using
two fixed-width typefaces (Nanum Gothic Coding and M PLUS Rounded 1c)
in order to make the mixed English-Japanese legible for everyone.

```yaml
- id: fontUrl
translation: "https://fonts.googleapis.com/css2?family=Nanum+Gothic+Coding:wght@400;700&family=M+PLUS+Rounded+1c:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700&display=swap"
- id: bodyFontFamily
translation: "'Noto Sans JP', sans-serif"
- id: headingFontFamily
translation: "'Noto Sans JP', sans-serif"
- id: codeFontFamily
translation: "'Nanum Gothic Coding' 'M PLUS Rounded 1c', monospace"
```


There *must* be some backup font included -- The stylesheet will not
provide one for you. As a rule of thumb, Noto makes a good option for
most languages, with `sans-serif` falling back on whatever the browser
can provide most efficiently. Code fonts should be monospace.

If you can, you want at least the following weights:

* 400 (used for body text)
* 500 (used for for headlines)
* 700 (used for bold text)

Do *not* use "artsy" typefaces. According to AWS style guides, we
should be using Ember, but the typeface isn't cleared for hosting on
GitHub. Until then, we'll use Noto Sans as a default where reasonable.

*The use of serifed headlines is allowed* if the language expects it.
Chinese is monotonous to read when only presented in "sans". To give
a clean distinction between headline and body, CJK languages or any
language which "prefers" a certain type of headline may opt to use
a "serif" (read: alternate style) headline typeface.

When in doubt, ask a native speaker and look to examples of type in
that language (technical books, newspapers, etc are good starts) to
find guidance in what historically separates headline text from the
body text. AWS customers (and employees!) come from all around the
world, and this is intended to cater to them.

## Website Infrastructure

The workshop is available at https://cdkworkshop.com. It's a static website hosted on S3 and served through CloudFront.

It is implemented as a (_surprise_) CDK application under the `cdkworkshop.com`
directory.

* `npm install` - bootstrap.
* `npm run build` and `npm run watch`
* `npm run deploy` - build & deploy

### Auto-deployment

You shouldn't have to manually deploy: Any commit merged into `main` should cause the site to self-deploy via CodeBuild.

## License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.
7 changes: 7 additions & 0 deletions cdkworkshop.com/cdkworkshop.com.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env node

// NOTE: Before redirect
// https://github.com/aws-samples/aws-cdk-intro-workshop/pull/1478/files?diff=unified&w=1#diff-037ad33a0965a87240f9aeb7d2efa871f2012bce547a01b5b3c703b3dc16c0f9

// to be converted, similar to learn.terraconstructs.dev
// https://github.com/TerraConstructs/learn/blob/main/infra/main.ts

import {
aws_certificatemanager as acm,
aws_cloudfront as cloudfront,
Expand Down
Binary file not shown.
17 changes: 9 additions & 8 deletions cdkworkshop.com/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cdkworkshop.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"@biomejs/biome": "1.8.3",
"@types/node": "^20.14.11",
"aws-cdk": "^2.149.0",
"typescript": "^5.5.3"
"typescript": "^5.8.3"
},
"repository": {
"url": "https://github.com/aws-samples/aws-cdk-intro-workshop.git",
"url": "https://github.com/terraconstructs/intro-workshop.git",
"type": "git"
},
"dependencies": {
"aws-cdk-lib": "^2.150.0",
"constructs": "^10.3.0"
},
"engines": {
"node": ">= 10.0.0"
"node": ">= 20.0.0"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { awscdk } = require('projen');
const { NodePackageManager } = require('projen/lib/javascript');
const { ReleaseTrigger } = require('projen/lib/release');

const project = new awscdk.AwsCdkConstructLibrary({
Expand Down Expand Up @@ -26,6 +27,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
},
majorVersion: 1,
releaseTrigger: ReleaseTrigger.manual(),
packageManager: NodePackageManager.PNPM,

// deps: [], /* Runtime dependencies of this module. */
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"aws-cdk-lib": "2.80.0",
"cdkworkshop-lib": "^1.0.1",
"cdkworkshop-lib": "workspace:*",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21"
}
Expand Down
10 changes: 8 additions & 2 deletions code/typescript/main-workshop/bin/cdk-workshop.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { App } from 'aws-cdk-lib';
import { App } from 'cdktf';
import { CdkWorkshopStack } from '../lib/cdk-workshop-stack';

const app = new App();
new CdkWorkshopStack(app, 'CdkWorkshop');
new CdkWorkshopStack(app, 'CdkWorkshop', {
environmentName: "Workshop",
gridUUID: "workshop",
providerConfig: {
region: "ap-southeast-1"
}
});
Loading