feat(synthetics): cleanup provisioned lambda and layers for canary#32738
feat(synthetics): cleanup provisioned lambda and layers for canary#32738mergify[bot] merged 21 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32738 +/- ##
=======================================
Coverage 81.57% 81.57%
=======================================
Files 227 227
Lines 13793 13793
Branches 2419 2419
=======================================
Hits 11251 11251
Misses 2270 2270
Partials 272 272
Flags with carried forward coverage won't be shown. Click here to find out more.
|
lpizzinidev
left a comment
There was a problem hiding this comment.
👍 Left comments for minor adjustments
There was a problem hiding this comment.
Can you please update the Deleting underlying resources on canary deletion paragraph with a description of the new attribute?
There was a problem hiding this comment.
Oh.. I've forgotten to update the readme. Thanks!
| * responsible for cleaning up all other resources left behind | ||
| * by the Canary. | ||
| * | ||
| * @deprecated use provisionedResourceCleanup |
There was a problem hiding this comment.
I guess we should deprecate the cleanup property instead 🤔
There was a problem hiding this comment.
I've made cleanup deprecated.
|
@lpizzinidev Thank you for your review! I've addressed your comments. |
|
|
||
| const app = new App(); | ||
|
|
||
| new IntegTest(app, 'SyntheticsCanaryProvisionedResourceCleanup', { |
There was a problem hiding this comment.
Could we add assertions to this test to GetCanary to get the Lambda layer, DeleteCanary and then verify the lambda layer does not exist?
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
gracelu0
left a comment
There was a problem hiding this comment.
Thank you for contributing!
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@mergify update |
❌ Mergify doesn't have permission to updateDetailsFor security reasons, Mergify can't update this pull request. Try updating locally. |
|
@mergify update |
✅ Branch has been successfully updated |
| } | ||
|
|
||
| if (props.cleanup === Cleanup.LAMBDA && props.provisionedResourceCleanup) { | ||
| throw new Error('Cannot specify `provisionedResourceCleanup` when `cleanup` is set to `Cleanup.LAMBDA`. Use only `provisionedResourceCleanup`.'); |
There was a problem hiding this comment.
@badmintoncryer I think the build is failing due to this error: aws-cdk-lib: /codebuild/output/src1859401526/src/github.com/aws/aws-cdk/packages/aws-cdk-lib/aws-synthetics/lib/canary.ts aws-cdk-lib: 358:13 error Expected a non-default error object to be thrown @cdklabs/no-throw-default-error
I think the error needs to be updated from Error to ValidationError due to this PR where we are now enforcing specific error types: #33079
Pull request has been modified.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
None
Reason for this change
For the Lambda and Layer used in Canary, the deletion of related resources is handled by a custom resource, but this functionality is now supported natively by CloudFormation.
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-provisionedresourcecleanup
Description of changes
provisionedResourceCleanupprop toCanaryPropscleanupprop which uses custom resourceDescribe any new or updated permissions being added
None
Description of how you validated changes
Add both unit and integ test
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license