-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(synthetics): enable auto delete lambdas via custom resource (#26580
) Synthetics [used](https://aws.amazon.com/about-aws/whats-new/2022/05/amazon-cloudwatch-synthetics-support-canary-resources-deletion/) to have a property `deleteLambdaResourceOnCanaryDeletion` that has since been deprecated and erased from cloudformation docs. Although this property still works today synthetics makes no promises that this is supported in the future. Here in CDK land, this PR serves as a replacement to the `deleteLambdaResourceOnCanaryDeletion` property (called `enableAutoDeleteLambdas` on the L2 Canary) by implementing a custom resource similar to what we have in S3 and ECR. **This PR deprecates `enableAutoDeleteLambdas` in favor of `cleanup: cleanup.LAMBDA`, an enum that achieves the same thing but via custom resource** Closes #18448 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
33 changed files
with
4,270 additions
and
1,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/@aws-cdk/aws-synthetics-alpha/scripts/airlift-custom-resource-handlers.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
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/aws-synthetics-alpha/*/index.js; do | ||
echo $file | rev | cut -d "/" -f 2-4 | rev | ||
done | ||
} | ||
|
||
customresources=$(list_custom_resources) | ||
|
||
echo $customresources | ||
|
||
cd $awscdklibdir | ||
mkdir -p $awscdklibdir/custom-resource-handlers | ||
|
||
for cr in $customresources; do | ||
mkdir -p $awscdklibdir/custom-resource-handlers/$cr | ||
cp $customresourcedir/$cr/index.js $awscdklibdir/custom-resource-handlers/$cr | ||
done |
Oops, something went wrong.