-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
# Conflicts: # packages/type-safe-api/src/construct/spec/utils.ts
- Loading branch information
There are no files selected for viewing
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.
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.
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.
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.
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 |
---|---|---|
|
@@ -182,21 +182,30 @@ git config --global user.email "[email protected]" | |
git config --global user.name "username" | ||
``` | ||
|
||
### JDK + Maven (If using Type Safe API) | ||
|
||
The Type Safe API requires JDK >= 11 and Maven >= 3.8 in order to perform the required code generation. | ||
|
||
To install these, follow the below links: | ||
|
||
- JDK: We recommend installing any Coretto version >= 11 https://docs.aws.amazon.com/corretto/ | ||
- Maven: You can any version of Maven >= 3.8: https://maven.apache.org/install.html | ||
|
||
### Language specific | ||
|
||
Other prerequisites depend on the language in which you develop AWS PDK projects and are as follows. | ||
|
||
=== "TYPESCRIPT" | ||
- `Node >= 16` | ||
- `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap] | ||
- `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap]: https://pnpm.io/installation | ||
- `YARN` [if `--package-manager` flag is unset]: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable | ||
|
||
=== "PYTHON" | ||
- `Python >= 3.9` | ||
- `Poetry >= 1.5.1` | ||
- `Python >= 3.9`: https://github.com/pyenv/pyenv | ||
- `Poetry >= 1.5.1`: https://python-poetry.org/docs/ | ||
- `YARN`: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable | ||
|
||
=== "JAVA" | ||
- `JDK >= 11` | ||
- `Apache Maven >= 3.8` | ||
- `YARN`: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable | ||
|
||
### Install the AWS CDK | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,72 +26,7 @@ We'll also show how to add a new API operation, implement an API handler, and wi | |
|
||
## Prerequisites | ||
|
||
The following subsections outline what you need to install and use the AWS PDK. | ||
|
||
### Node runtime | ||
|
||
All AWS PDK developers, even those working in Python or Java, need Node.js 16 or later. All supported languages use the same backend, which runs on Node.js. We recommend a version in active long-term support. Your organization may have a different recommendation. | ||
|
||
!!!tip | ||
We recommend installing [`nvm`](https://github.com/nvm-sh/nvm#installing-and-updating) and configuring it to use Node 18. | ||
|
||
### PDK CLI | ||
|
||
Once your NodeJs ruuntime is set up, run the following command to install the pdk CLI: | ||
|
||
```bash | ||
npm install -g @aws/pdk | ||
``` | ||
|
||
Run the following command to verify correct installation and print the version number of the AWS PDK. | ||
|
||
`pdk --version` | ||
|
||
!!!warning | ||
The `pdk` command is a wrapper command which delegates to either a package manager or a projen command depending on the context. As such it may be possible that certain arguments may not operate as expected. | ||
|
||
### Git | ||
|
||
[Git](https://git-scm.com/) is also required to be installed and configured when bootstrapping new applications unless the `--no-git` flag is specified when executing the `pdk new` command. | ||
|
||
Ensure to configure a username and email via the below commands once installed: | ||
|
||
```bash | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "username" | ||
``` | ||
|
||
### Language specific | ||
|
||
Other prerequisites depend on the language in which you develop AWS PDK projects and are as follows. | ||
|
||
=== "TYPESCRIPT" | ||
- `Node >= 16` | ||
- `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap] | ||
|
||
=== "PYTHON" | ||
- `Python >= 3.9` | ||
- `Poetry >= 1.5.1` | ||
|
||
=== "JAVA" | ||
- `JDK >= 11` | ||
- `Apache Maven >= 3.8` | ||
|
||
### Install the AWS CDK | ||
|
||
You will need to install the AWS CDK in order to bootstrap and deploy your infrastructure to AWS. To install, run the following command: | ||
|
||
`npm install -g aws-cdk` | ||
|
||
Run the following command to verify correct installation and print the version number of the AWS CDK. | ||
|
||
`cdk --version` | ||
|
||
### Authentication with AWS | ||
|
||
You must establish how the AWS CDK authenticates with AWS when deploying infrastructure. There are different ways in which you can configure programmatic access to AWS resources, depending on the environment and the AWS access available to you. | ||
|
||
For an in depth guide, please refer to: https://docs.aws.amazon.com/sdkref/latest/guide/access.html | ||
Refer to [prerequisites](./index.md#prerequisites). | ||
|
||
## Create your project | ||
|
||
|
@@ -151,7 +86,7 @@ Inspecting the `projenrc` file, we notice that a single construct is instantiate | |
- Any parameter listed here can be passed in via the `pdk new` command i.e: `--name="some-other-name"`. | ||
- For python, the moduleName defaults to a snake-cased project name. | ||
|
||
You will also notice that the `synth()` method is called on this instance at the end of the file. When you run the `pdk` command, this file will be executed by your runtime and will synthesize this instance which will result in all the files that you see in the previous image. | ||
You will also notice that the `synth()` method is called on this instance at the end of the file. When you run the `pdk` command, this file will be executed by your runtime and will synthesize this instance which will result in all the files that you see in the previous image. | ||
|
||
!!!info | ||
Whenever you change the `projenrc` file, make sure you run the `pdk` command from the root of your project to ensure your files are synthesized. | ||
|
@@ -358,7 +293,7 @@ For more details on these packages, refer to the [Type-Safe API Developer Guide] | |
Now, lets build our API by running `pdk build` from the root of our monorepo. You will notice that each package in the monorepo is built in dependency order. | ||
|
||
!!!tip | ||
If you run the `pdk build` command again without changing any files, you will notice that the build completes in a fraction of the time (1.7s as per below snippet) as it uses [cached results](https://nx.dev/concepts/how-caching-works) and will only re-build packages that have changed since the last time it was built. | ||
If you run the `pdk build` command again without changing any files, you will notice that the build completes in a fraction of the time (1.7s as per below snippet) as it uses [cached results](https://nx.dev/concepts/how-caching-works) and will only re-build packages that have changed since the last time it was built. | ||
|
||
```bash | ||
> NX Successfully ran target build for 7 projects | ||
|
@@ -803,9 +738,12 @@ We now can deploy our infrastructure by running the following command: | |
|
||
```bash | ||
cd packages/infra | ||
pdk run deploy --require-approval never | ||
pdk deploy:dev | ||
``` | ||
|
||
!!!note | ||
The `pdk deploy:dev` command attempts a [CDK hotswap deployment](https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/) if possible. In a production setting (for example in a ci/cd pipeline) use the `pdk deploy` command to ensure a full CloudFormation deployment is performed. | ||
|
||
Once the deployment completes, you should see an output that resembles the following: | ||
|
||
<img src="../assets/images/deployment_results.png" width="600" /> | ||
|
@@ -821,7 +759,7 @@ In order to log in to your website, you first need to create a Cognito user. By | |
1. Navigate to the Cognito AWS console within the account you just deployed to. | ||
1. Click on the user pool you just created | ||
1. Click "Create user" | ||
1. In invitation settings, select "Send an email invitation" | ||
1. In invitation settings, select "Send an email invitation" | ||
1. Enter a username | ||
1. Enter an email address | ||
1. In temporary password, select "Generate a password" | ||
|
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.