-
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
aws-s3: SkipDestinationValidation should not have default value when not used. It triggers CR's accidentally #31230
Comments
#30914 |
Findings:
@heikkis Please advise an end-to-end scenario with minimal reproducible CDK code which demonstrates that the custom resource would be triggered when Thanks, |
I think @heikkis 's concern is that - when it's not set, it should leave as This passes an explicit And because of that, here would be passed an explicit Am I understanding this correct? |
Thank you for bringing this to our attention. I can implement a similar fix to #30418 where we set the default of SkipDestinationValidation as |
No parameter changes (add or delete) should be added by default to CR's. I think if it is undefined it want be added at all => wanted way 👍🏼 |
I wrote a work-around for this today by finding all stack resources of type
|
@ryanwilliams83 not to ask too stupid of a question, but how do you apply your workaround? Thank you! |
My workaround is code in the CDK stack that you add last in the constructor. It enumerates all nodes in the stack safe casting them from IResource to CfnResource. Then filter the list to find the node that is the CustomResource itself. Finally use the Amazon provided "escape hatch" function CfnResource.addPropertyDeletionOverride() to cause CDK to Delete a CloudFormation property from the synthesized output. The problem arises because the CloudFormation synthesised with new versions of CDK contains the SkipValidation property whereas older versions did not. The fact that the CloudFormation has changed between the time you first provisioned your bucket trigger now causes the CR (Custom Resource) to be executed by CloudFormation which can result in the error about ambiguous triggers. As you may be aware CloudFormation will attempt to provision new resources before cleaning up old ones while applying a "Change Set". If you're still stuck paste my code into ChatGPT, tell it you found a workaround for the ambiguous bucket trigger problem introduced when the SkipValidation property was recently added, and ask it to write the equivalent work-around in your language of choice. |
@heikkis I'm working on a fix |
Describe the bug
#30914 introduced default value that is set always to false. The wanted behaviour would be that it would be omit when not defined.
Similar issue like this which was rollback: #30121
Regression Issue
Last Known Working CDK Version
2.154.1
Expected Behavior
No default value. Default value triggers all custom resources.
Current Behavior
Added new default value -> triggers CRs
Reproduction Steps
Update CDK, CRs are triggered which causes problems in many CR definitions in generally (not designed for re-run).
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.154.1
Framework Version
No response
Node.js Version
latest
OS
any
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: