Skip to content

Commit

Permalink
chore(aws-cdk-lib): airlift stable custom resource handlers only (#27101
Browse files Browse the repository at this point in the history
)

Experimental custom resource handlers should be airlifted to their experimental modules only.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kaizencc authored Sep 12, 2023
1 parent a124706 commit b0a19c4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 20 additions & 1 deletion packages/@aws-cdk/custom-resource-handlers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,33 @@

This package contains the following custom resource handlers:

Stable:

- aws-s3/auto-delete-objects-handler
- aws-ecr/auto-delete-images-handler
- aws-events-targets/aws-api-handler
- custom-resources/aws-custom-resource-handler

These handlers are copied into `aws-cdk-lib/custom-resource-handlers` at build time
and included as part of the `aws-cdk-lib` package.

Experimental:

- aws-synthetics-alpha/auto-delete-underlying-resources-handler

In addition, it includes `nodejs-entrypoint.ts`, which is a wrapper that talks to
These handlers are excluded from `aws-cdk-lib/custom-resource-handlers` and are individually
copied into their respective `-alpha` packages at build time. When an `-alpha` package is
stabilized, part of the stabilization process **must** be to remove `-alpha` from the folder
name, so that it is included in `aws-cdk-lib`.

## Nodejs Entrypoint

This package also includes `nodejs-entrypoint.ts`, which is a wrapper that talks to
CloudFormation for you. At build time, `nodejs-entrypoint.js` is bundled into the
`.js` file of the custom resource handler, creating one `index.js` file. This file
is then either copied into a CDK asset or copied as inline code directly in the
CloudFormation template.

## Future Work

In the future this package will contain all custom resources and their tests.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ scriptdir=$(cd $(dirname $0) && pwd)
customresourcedir=$(node -p "path.dirname(require.resolve('@aws-cdk/custom-resource-handlers/package.json'))")
awscdklibdir=${scriptdir}/..

list_custom_resources() {
for file in $customresourcedir/dist/*/*/index.js; do
list_stable_custom_resources() {
for file in $customresourcedir/dist/*[^-alpha]/*/index.js; do
echo $file | rev | cut -d "/" -f 2-4 | rev
done
}

customresources=$(list_custom_resources)
customresources=$(list_stable_custom_resources)

echo $customresources

Expand Down

0 comments on commit b0a19c4

Please sign in to comment.