Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(aws-cdk-lib): airlift stable custom resource handlers only #27101

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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