Skip to content

Commit

Permalink
Merge branch 'mainline' into fix/python-request-param-descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cogwirrel authored Oct 20, 2023
2 parents c2a3f33 + 9d0bfd9 commit fb754b8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 74 deletions.
21 changes: 15 additions & 6 deletions docs/content/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
67 changes: 1 addition & 66 deletions docs/content/getting_started/your_first_aws_pdk_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ApiConstruct extends Construct {
// still be granted access to the API.
new PolicyStatement(PolicyStatementProps.builder()
.effect(Effect.ALLOW)
.principals(Arrays.asList(new AccountPrincipal(Stack.of(this))))
.principals(Arrays.asList(new AccountPrincipal(Stack.of(this).getAccount())))
.actions(Arrays.asList("execute-api:Invoke"))
.resources(Arrays.asList("execute-api:/*"))
.build()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ApplicationStackTest {
@Test
public void myTest() {
App app = new App();
ApplicationStack stack = new ApplicationStack(app, "test");
ApplicationStack stack = new ApplicationStack(app, "test", null);
Template template = Template.fromStack(stack);
expect.serializer("json").toMatchSnapshot(template.toJSON());
Expand Down

0 comments on commit fb754b8

Please sign in to comment.