CI/CD for AWS infrastructure using AWS CDK
Sythesize and deploy CloudFormation using AWS CDK.
Use template →1steps:
2 - label: ":npm: install deps"
3 command: "npm install"
4 key: "deps"
5 plugins:
6 - artifacts#v1.9.3:
7 upload: "node_modules"
8 compressed: node_modules.tgz
9
10 - label: ":jest: run tests"
11 command: "npm test"
12 depends_on: "deps"
13 key: "test"
14 plugins:
15 - artifacts#v1.9.3:
16 upload: "node_modules"
17 compressed: node_modules.tgz
18
19 - label: ":aws-logo: cdk synth"
20 depends_on: "test"
21 commands:
22 - "npx cdk synth"
23 plugins:
24 - artifacts#v1.9.3:
25 download: "node_modules"
26 compressed: node_modules.tgz
27 - aws-assume-role-with-web-identity:
28 role-arn: arn:aws:iam::AWS-ACCOUNT-ID:role/SOME-ROLE
29 - docker:
30 image: node:latest
31
32 - block: Deploy?
33
34 - label: ":aws-logo: cdk deploy"
35 commands:
36 - "npx cdk deploy"
37 plugins:
38 - artifacts#v1.9.3:
39 download: "node_modules"
40 compressed: node_modules.tgz
41 - aws-assume-role-with-web-identity:
42 role-arn: arn:aws:iam::AWS-ACCOUNT-ID:role/SOME-ROLE
43 - docker:
44 image: node:latest
- Languages
- JavaScript
- Platforms
- AWS
- Tools
- CDK
CI/CD for AWS infrastructure using AWS CDK
This template gives you a continuous integration (CI) pipeline for testing, deploying, modifying, and destroying AWS infrastructure using AWS CDK.
At a glance:
- For AWS CDK projects
- Uses Docker with a Node.js image.
- Uses Node.js and npm
- Uses the AWS Assume Role plugin to access AWS credentials
- Deploys to AWS
How it works
This template:
- Runs tests over your CDK project
- Assumes an AWS role using the AWS Assume Role with Web Identity plugin.
- Synthesizes an AWS CloudFormation template, which is available as an artifact.
- Blocks for input before conditionally deploying/updating/deleting your stack resources to AWS.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your AWS CDK project.
- Replace the placeholder AWS role ARN in the pipeline definition.
- Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.