Skip to content

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.
      • Is the change runtime related?
        • Make the change in src/installer/cdk/assets.
    • Is the change related to the Initial Setup stack?
      • Is the change CDK related?
        • Make the change in src/core/cdk
      • Is the change runtime related?
        • Make the change in src/core/runtime
  • 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
      • Is the change runtime related?
        • Make the change in src/deployments/runtime

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.

  1. Create a separate folder that contains the CDK and Lambda function runtime code, e.g. src/lib/custom-resources/my-custom-resource;
  2. Create a folder my-custom-resource that contains the CDK code;
    1. Create a package.json file with a dependency to the my-custom-resource/runtime package;
    2. Create a cdk folder that contains the source of the CDK code;
  3. Create a folder my-custom-resource/runtime that contains the runtime code;
    1. Create a runtime/package.json file with a "name", "prepare" script and a "main";
    2. Create a runtime/webpack.config.ts file that compiles TypeScript code to a single JavaScript file;
    3. Create a runtime/src folder that contains the source of the Lambda function runtime code;

You can look at the 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