aws-cdk-lib/aws-s3: How to add depend on
between s3 bucket policy and event notification?
#29489
Replies: 3 comments
-
You have a circular dependency: By adding the notification to the bucket, you've created an intrinsic dependency of the bucket on the topic. By adding a dependency of the topic on the bucket, you have created an impossible to resolve dependency graph. Create each construct separately and assign it. Tokens will be used in place and CloudFormation will be able to resolve it. |
Beta Was this translation helpful? Give feedback.
-
@indrora the topic is imported, which means there won't be a topic in the CloudFormation template to create a cyclic resource. This also isn't typically the error message you'd see when a circular dependency is created. Can you expand on your findings and provide an example of how to work around this? |
Beta Was this translation helpful? Give feedback.
-
Converting to a discussion since this involves a guidance question. Please let us know if you have any updates on your end as far as testing on more recent versions. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature
I am using CDK to deploy s3 bucket and also add an event notification on that bucket. The code I have is:
The problem I have is I got a deployment error: Resource handler returned message:
"A conflicting conditional operation is currently in progress against this resource. Please try again.
It says there are multiple operations tried to deploy at the same time which conflict with each other. When examining the cloud trail, I found there are two events happened at the same time period, one is PutBucketPolicy, the other is PutBucketNotification.
How can I add depend_on between PutBucketPolicy and PutBucketNotification?
Use Case
Solve conflict error during deployment
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
"aws-cdk": "^2.80.0",
Environment details (OS name and version, etc.)
Mac 14
Beta Was this translation helpful? Give feedback.
All reactions