Skip to content

Commit 53d24f1

Browse files
authored
chore(doc): update contributing guide (#25361)
Before running `yarn integ` it's required to build up the `framework-integ`, which is not mentioned in the doc and we are having error report from the [slack community](https://cdk-dev.slack.com/archives/C041656G340/p1682606764515889). - [x] add `Build framework-integ` section - [x] update gitpod section and suggest using AWS IAM Identity Center(AWS SSO) for AWS authentication - [x] add Amazon CodeCatalyst DevEnv as suggested dev environment as well - [x] some minor content fix and anchor link fix Closes #<issue number here>. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5bdb012 commit 53d24f1

File tree

1 file changed

+49
-6
lines changed

1 file changed

+49
-6
lines changed

CONTRIBUTING.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti
5151

5252
The following steps describe how to set up the AWS CDK repository on your local machine.
5353
The alternative is to use [Gitpod](https://www.gitpod.io/), a Cloud IDE for your development.
54-
See [Gitpod section](#gitpod-alternative) on how to set up the CDK repo on Gitpod.
54+
See [Gitpod section](#gitpod) on how to set up the CDK repo on Gitpod.
5555

5656
### Setup
5757

@@ -92,7 +92,7 @@ CDK can be found at the location `packages/aws-cdk-lib/aws-iam`.
9292
The repo also contains the `tools/` directory that holds custom build tooling (modeled as private npm packages)
9393
specific to the CDK.
9494

95-
### Build
95+
### Building aws-cdk-lib
9696

9797
The full build of all of the packages within the repository can take a few minutes, about 20 when all tests are run.
9898
Most contributions only require working on a single package, usually `aws-cdk-lib`. To build this package for the first
@@ -162,7 +162,7 @@ Please follow the [setup instructions](https://code.visualstudio.com/docs/remote
162162

163163
With VS Code setup, you will be prompted to open the `aws-cdk` repo in a Dev Container, or you can choos "Dev Containers: Reopen in Container" from the VS Code command palette.
164164

165-
### Gitpod (Alternative)
165+
### Gitpod
166166

167167
You may also set up your local development environment using [Gitpod](http://gitpod.io) -
168168
a service that allows you to spin up an in-browser Visual Studio Code-compatible editor,
@@ -177,7 +177,22 @@ You can now work on your CDK repository, as described in the [Getting Started](#
177177
Gitpod is free for 50 hours per month - make sure to stop your workspace when you're done
178178
(you can always resume it later, and it won't need to run the build again).
179179

180-
For Gitpod users only! The best way to supply CDK with your AWS credentials is to add them as
180+
For Gitpod users only! The best way to authenticate AWS in Gitpod is to use AWS IAM Identity Center(successor to AWS Single Sign-On). [Install AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions) and configure it as follows:
181+
182+
```shell
183+
# make sure AWS CLI v2 is in your $PATH
184+
$ aws --version
185+
# configure the AWS profile with SSO
186+
$ aws configure sso
187+
# login and authenticate
188+
$ aws sso login
189+
# verify your current identity
190+
$ aws sts get-caller-identity
191+
```
192+
193+
Check out [this document](https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html) for the details.
194+
195+
Alternatively, supply CDK with your AWS credentials as
181196
[persisting environment variables](https://www.gitpod.io/docs/environment-variables).
182197
Adding them works as follows via terminal:
183198

@@ -188,6 +203,26 @@ eval $(gp env -e AWS_DEFAULT_REGION=ZZZZZZZZ)
188203
eval $(gp env -e)
189204
```
190205

206+
### Amazon CodeCatalyst Dev Environments
207+
208+
Dev Environments are cloud-based development environments.
209+
[Amazon CodeCatalyst](https://aws.amazon.com/codecatalyst/) allows you to checkout your linked Github
210+
repositories in your Dev Environments with your favorite local IDEs such as VSCode or JetBrains.
211+
212+
Build up `aws-cdk-lib` as well as `framework-integ` when you enter your Dev Env:
213+
214+
```shell
215+
$ yarn install
216+
$ NODE_OPTIONS=--max-old-space-size=8192 npx lerna run build --scope=aws-cdk-lib --scope=@aws-cdk-testing/framework-integ
217+
```
218+
219+
You may [configure your Dev Env](https://docs.aws.amazon.com/codecatalyst/latest/userguide/devenvironment-devfile.html) with the `devfile.yaml` to further customize your Dev Env for CDK development.
220+
221+
Read the links below for more details:
222+
- [Dev Environments in CodeCatalyst](https://docs.aws.amazon.com/codecatalyst/latest/userguide/devenvironment.html)
223+
- [Using GitHub repositories in CodeCatalyst](https://docs.aws.amazon.com/codecatalyst/latest/userguide/extensions-github.html)
224+
- [Setting up to use the AWS CLI with CodeCatalyst](https://docs.aws.amazon.com/codecatalyst/latest/userguide/set-up-cli.html)
225+
191226
## Pull Requests
192227

193228
Below is a flow chart that describes how your PR may be treated by repository maintainers:
@@ -279,6 +314,14 @@ Integration tests perform a few functions in the CDK code base -
279314
3. (Optionally) Acts as a way to validate that constructs set up the CloudFormation resources as expected. A successful
280315
CloudFormation deployment does not mean that the resources are set up correctly.
281316

317+
**Build framework-integ**
318+
319+
You need to build the `framework-integ` before running the `yarn integ`
320+
321+
```console
322+
$ npx lerna run build --scope=@aws-cdk-testing/framework-integ
323+
```
324+
282325
**When are integration tests required?**
283326

284327
The following list contains common scenarios where we _know_ that integration tests are required.
@@ -308,7 +351,7 @@ Examples:
308351
* [integ.destinations.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda-destinations/test/integ.destinations.ts#L7)
309352
* [integ.put-events.ts](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-stepfunctions-tasks/test/eventbridge/integ.put-events.ts)
310353

311-
**What do do if you cannot run integration tests**
354+
**What if you cannot run integration tests**
312355

313356
If you are working on a PR that requires an update to an integration test and you are unable
314357
to run the `cdk-integ` tool to perform a real deployment, please call this out on the pull request
@@ -429,7 +472,7 @@ $ yarn integ --directory test/aws-eks/test
429472
Or run a specific integ test:
430473

431474
```console
432-
$ yarn integ --directory test/aws-eks/test/integ.name.js
475+
$ yarn integ test/aws-eks/test/integ.name.js
433476
```
434477

435478
See the [integration test guide](./INTEGRATION_TESTS.md) for a more complete guide on running

0 commit comments

Comments
 (0)