-
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(sns): enable passing PolicyDocument to TopicPolicy #10559
Conversation
merging new changes from master of aws/aws-cdk
TopicPolicy class had a bug. It did specify a mandatory prop for IAM policy document to use in AWS::SNS::TopicPolicy fixes aws#7934
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.
Sorry for the delay here. I was really reticent to make this a required property and then in the future want to go back to making it optional which would require a breaking change. It looks like the issue here is that we don't JSON
ify the PolicyDocument before passing it to the L1. So we can make the property optional, then call toJSON
on this.policyDocument
so that the default value is correctly passed to the template.
Ignore me 🤣
Actually I'm dismissing that review as that still doesn't result in an empty policy document in the template. Passing an empty JSON object also doesn't work as then it fails at deploy time. It does look like there is no sensible default we could provide for the policy document so required is the way to go. Just gonna double confirm that though. |
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.
Thank you!!
Pull request has been modified.
Pull request has been modified.
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.
Because the construct is in fact usable now, we can't break users by adding a new required property to input. It does make sense to still add this property to allow users to pass existing PolicyDocuments/Statements etc, so I just changed it to be optional and added an additional test to prevent future breakage of the topicPolicy.document.addStatements
workflow.
Pull request has been modified.
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from master 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 master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Adds optional `policyDocument` prop to `TopicPolicyProps` to allow passing existing policy documents. fixes aws#7934 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Adds optional `policyDocument` prop to `TopicPolicyProps` to allow passing existing policy documents. fixes aws#7934 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Adds optional `policyDocument` prop to `TopicPolicyProps` to allow passing existing policy documents. fixes aws#7934 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Adds optional
policyDocument
prop toTopicPolicyProps
to allow passing existing policy documents.fixes #7934
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license