-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(synthetics): cleanup provisioned lambda and layers for canary #32738
base: main
Are you sure you want to change the base?
feat(synthetics): cleanup provisioned lambda and layers for canary #32738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.39% 81.39%
=======================================
Files 225 225
Lines 13714 13714
Branches 2411 2411
=======================================
Hits 11162 11162
Misses 2277 2277
Partials 275 275
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Left comments for minor adjustments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. I've forgotten to update the readme. Thanks!
@@ -70,6 +70,8 @@ export enum Cleanup { | |||
* Clean up the underlying Lambda function only. The user is | |||
* responsible for cleaning up all other resources left behind | |||
* by the Canary. | |||
* | |||
* @deprecated use provisionedResourceCleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should deprecate the cleanup
property instead 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made cleanup
deprecated.
@lpizzinidev Thank you for your review! I've addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
|
||
const app = new App(); | ||
|
||
new IntegTest(app, 'SyntheticsCanaryProvisionedResourceCleanup', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add assertions to this test to GetCanary
to get the Lambda layer, DeleteCanary
and then verify the lambda layer does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gracelu0 I've updated integ test!
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. |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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
provisionedResourceCleanup
prop toCanaryProps
cleanup
prop 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