Contributing to AWS CDK

Contributing to AWS CDK

Making your first pull request to aws/aws-cdk on GitHub

Pahud Hsieh
Amazon Employee
Published Jul 25, 2024
Last Modified Aug 9, 2024
AWS Cloud Development Kit (CDK) is an open-source software development framework to model and provision your cloud application resources using familiar programming languages. Contributing to AWS CDK not only helps you deepen your knowledge of AWS services but also allows you to give back to the community and improve a tool you rely on.

Why Contributing to AWS CDK

Contributing to AWS CDK is beneficial for several reasons:
  • Skill Enhancement: Working on real-world projects helps you enhance your coding skills and gain deeper insights into cloud development.
  • Community Engagement: By contributing, you become a part of a vibrant community of developers who are passionate about cloud infrastructure and development.
  • Professional Recognition: Open-source contributions are highly regarded in the tech industry and can bolster your professional profile.
  • Shaping the Tool: Your contributions help shape the tool, ensuring it meets the needs of the community and stays up-to-date with the latest advancements in cloud technology.

Get Started

  • AWS CDK Contributing Guide: Everything you need to know is in the official contributing guide. Be sure to check it out to have a general idea about getting started.
  • Search Existing Issues and Pull Requests: The AWS CDK community is highly active, with numerous discussions and ongoing pull requests. If you have a specific issue or feature request, be sure to search for existing ones on the AWS CDK GitHub repository to avoid duplicates.
  • Submit your first issue: If you can't find a similar issue or feature request, it's important to submit an issue before creating a pull request. Clearly describe the bug or feature you’re addressing. Include detailed information about your use cases, the expected behavior, and the current behavior. This helps the maintainers and community understand the context and importance of your contribution.

Videos

Now you have an issue you are addressing with your first pull request, check those videos out to walk you through getting started.
Take a look at this video by Lee Packham and Rico Huijbers from AWS re:Invent 2019 for a general overview of contributing to the AWS Construct Library. Although it's a bit dated, it remains very helpful.
  • A real walkthrough video by myself for PR#29907.
0:00 opening
0:37 about the issue
1:56 confirm and verify this issue
5:13 check the CFN doc
6:09 read the source code
12:33 prepare our dev env with Amazon CodeCatalyst
14:40 open the DevEnv
15:14 build up aws-cdk project
16:49 define our contribution plan
17:59 start the hack
20:02 write a tiny sample.ts to verify by real deployments
24:12 writing unit tests
27:14 integ testing
30:57 git commit and push
31:57 create the PR from github
32:58 improve the doc string and commit again
33:35 closing and wrapping up
  • A real walkthrough video by myself for PR#22312.

0:00:00
Introduction
0:02:58 Install the Gitpod browser extension
0:04:56 read the issue
0:06:08 read the source code of launch-template.ts
0:07:30 check the cloudformation doc for MetadataOptions
0:09:36 open a Gitpod workspace for this PR
0:11:16 connect local VSCode to the Gitpod workspace
0:13:02 yarn install
0:14:23 run `buildup` for aws-ec2
0:15:59 open the launch-template.ts and start coding
0:32:07 write a integ.launch-template.ts to test the new feature
0:36:44 alias `cdk` CLI to the correct path
0:37:30 yarn watch
0:38:24 `cdk synth` for the first time and check the YAML
0:39:55 configure your AWS account
0:40:16 option 1 - add credentials as persisting env vars in Gitpod
0:42:10 option 2 - use AWS SSO
0:42:24 install AWS CLI V2 for AWS SSO
0:43:38 add ~/.aws/config
0:44:01 aws sso login
0:44:28 run `aws sts get-caller-identity` to validate the current identity
0:44:59 run `cdk diff` first
0:45:47 run `cdk deploy`
0:46:11 check the cloudformation console
0:49:10 commit current progress to our branch in the fork repo
0:51:36 submit a draft PR
0:54:36 continue our development and open a new workspace from PR
0:57:57 complete our integ testing and generate the snapshot
1:00:13 yarn test to validate the snapshot
1:01:46 git commit
1:02:05 add unit tests
1:05:23 run `yarn test` to check all tests
1:05:50 git commit
1:06:08 update README
1:06:48 yarn awslint
1:07:35 git commit and check the PR
1:08:22 debug the failed CodeBuild CI build
1:09:25 refactor our design
1:11:32 commit and push again
1:11:43 CI passed
1:11:54 ready for review
1:12:08 closing

Community and Support

Being a part of the AWS CDK community means you have access to a wide range of support resources:
  • GitHub Discussions and Issues: Engage with other contributors, ask questions, and get help on specific issues.
  • AWS CDK Slack Channel: Join the AWS CDK community Slack(aka cdk.dev) to interact with the community in real-time.
  • Documentation: The official AWS CDK documentation is comprehensive and a valuable resource for both new and experienced users.
  • Community Contributions: Learn from other community contributions, read their code, and understand different approaches to solving problems.

Conclusion

Contributing to AWS CDK is a rewarding experience that offers numerous benefits, from skill enhancement to community engagement. By following the steps outlined above and utilizing the available resources, you can start making valuable contributions to this powerful tool. Happy coding!

What's Next?

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

1 Comment