AWS CloudFormation Construct Library
This module is part of the AWS Cloud Development Kit project.
Custom Resources
Custom Resources are CloudFormation resources that are implemented by
arbitrary user code. They can do arbitrary lookups or modifications
during a CloudFormation synthesis run.
You will typically use Lambda to implement a Construct implemented as a
Custom Resource (though SNS topics can be used as well). Your Lambda function
will be sent a CREATE
, UPDATE
or DELETE
message, depending on the
CloudFormation life cycle. It will perform whatever actions it needs to, and
then return any number of output values which will be available as attributes
of your Construct. In turn, those can be used as input to other Constructs in
your model.
In general, consumers of your Construct will not need to care whether
it is implemented in term of other CloudFormation resources or as a
custom resource.
Note: when implementing your Custom Resource using a Lambda, use
a SingletonLambda
so that even if your custom resource is instantiated
multiple times, the Lambda will only get uploaded once.
Example
The following shows an example of a declaring Custom Resource that copies
files into an S3 bucket during deployment (the implementation of the actual
Lambda handler is elided for brevity).
example of Custom Resource
The aws-cdk-examples repository has
examples for adding custom resources.
References
See the following section of the docs on details to write Custom Resources:
1.0.0 (2019-07-09)
General Availability of the AWS Cloud Development Kit!! πππ₯π₯πΎπΎ
We are excited to announce the 1.0.0 release of the AWS CDK β
including GA support for TypeScript, JavaScript, and Python!
We want to thank all of our early customers, and the hundreds of contributors,
for all the help and support in making this release a reality.
Thank you for the patience to deal with the many, many breaking changes that happened along the way.
This product would not be what it is today if it weren't for all the feedback,
diligent issue reporting (bugs, missing features, unclear documentation, etc.),
and code contributions from the community.
Special thanks go out to a few of our most prolific contributors who went above and beyond to help improve the CDK:
1.0.0 is a huge milestone for us, but it's still only the beginning!
We are excited to continue evolving the CDK, to introduce support for new languages and capabilities,
and to continue working closely with the open-source community.
Bug Fixes
- cli: output message when successfully synthesizing multiple stacks (#3259) (0c30f12)
- python: Make sure stack name in the init template does not contain illegal characters (#3261) (7d22b2c)