-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 sns_topic resource policy self referencing issue #4157
Comments
I'd like to add that |
+1 - Seeing the same issue here |
FWIW, you can construct the ARN if you know the region and your AWS account ID, which you should ;-)
|
Hi @wstaples Apologies for not getting back to you for so long for this issue. Recently, @radeksimko added a new resource to allow us to be better at doing this: https://www.terraform.io/docs/providers/aws/r/sns_topic_policy.html As you can see from the example, there is interpolation in there that allows us to reference the sns_topic name Does this help? Paul |
Hello! I'm going through |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I have an s3 bucket that I would like to subscribe to an SNS topic. However the topics policy needs the topics arn embedded in it. I don't have the arn because the topic has not been created yet. Here is an example:
If you remove the "resource" line from the policy everything will be created fine however if you try to add an event to the s3 bucket it will tell you S3 does not have permission to publish to that resource. If I add the "resource" line back to the policy with hardcoded arn everything works as expected.
I tried adding
#{aws_sns_topic.some_topic.arn}
to the "resource" line in the policy but it resulted in a "* Self reference:" error.Should terraform do this in multiple passes? or should a aws_sns_topic_policy resource be created?
Here is the aws doc that shows an example policy with the arn in it.
http://docs.aws.amazon.com/AmazonS3/latest/dev/ways-to-add-notification-config-to-bucket.html
The text was updated successfully, but these errors were encountered: