1. How to Contribute(link)
1.1. General(link)
Please first refer to and comply with the Contributing and Governance document found here
1.2. Adding New Functionality?(link)
Before making a change or adding new functionality you have to verify what kind of functionality is being added.
- Is it an Accelerator-management change?
- Is the change related to the
Installer
stack?- Is the change CDK related?
- Make the change in
src/installer/cdk
.
- Make the change in
- Is the change runtime related?
- Make the change in
src/installer/cdk/assets
.
- Make the change in
- Is the change CDK related?
- Is the change related to the
Initial Setup
stack?- Is the change CDK related?
- Make the change in
src/core/cdk
- Make the change in
- Is the change runtime related?
- Make the change in
src/core/runtime
- Make the change in
- Is the change CDK related?
- Is the change related to the
- Is it an Accelerator-managed change?
- Is the change related to the
Phase
stacks?- Is the change CDK related?
- Make the change in
src/deployments/cdk
- Make the change in
- Is the change runtime related?
- Make the change in
src/deployments/runtime
- Make the change in
- Is the change CDK related?
- Is the change related to the
1.3. Create a CDK Lambda Function with Lambda Runtime Code(link)
See CDK Code Dependency on Lambda Function Code for a short introduction.
1.4. Create a Custom Resource(link)
See Custom Resource and Custom Resources for a short introduction.
- Create a separate folder that contains the CDK and Lambda function runtime code, e.g.
src/lib/custom-resources/my-custom-resource
; - Create a folder
my-custom-resource
that contains the CDK code;- Create a
package.json
file with a dependency to themy-custom-resource/runtime
package; - Create a
cdk
folder that contains the source of the CDK code;
- Create a
- Create a folder
my-custom-resource/runtime
that contains the runtime code;- Create a
runtime/package.json
file with a"name"
,"prepare"
script and a"main"
; - Create a
runtime/webpack.config.ts
file that compiles TypeScript code to a single JavaScript file; - Create a
runtime/src
folder that contains the source of the Lambda function runtime code;
- Create a
You can look at the src/lib/custom-resources/cdk-acm-import-certificate
custom resource as an example.
It is best practice to add tags to any resources that the custom resource creates using the cfn-tags
library.
1.5. Run All Unit Tests(link)
Run in the root of the project.
pnpm recursive run test --no-bail --stream -- --silent
1.6. Accept Unit Test Snapshot Changes(link)
Run in src/deployments/cdk
.
pnpm run test -- -u
1.7. Validate Code with Prettier(link)
Run in the root of the project.
pnpx prettier --check **/*.ts
1.8. Format Code with Prettier(link)
Run in the root of the project.
pnpx prettier --write **/*.ts
1.9. Validate Code with tslint
(link)
Run in the root of the project.
pnpm recursive run lint --stream --no-bail