-
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
SQS policies need access to their own ARN #4354
Comments
+1, this bit me today |
Actually, it's possible to set the arn in the policy on creation using known data. "Resource": "arn:aws:sqs:${var.region}:${var.account_id}:queue-name" |
That's similar to the workaround I'm using - however with that approach I still get a diff for the queue policy every time I run terraform plan. |
@mdevs5531 I'm not sure that is related. I had a similar problem, and it appeared to be a whitespace or formatting issue. In the end I fixed it by copying the policy directly from the state file, so it looks like:
Harder to manage, but it does work. |
-> #3549 |
Also bit me today. |
+1 this is annoying me right now. |
@phinze if I had to submit a PR to address this, would you prefer 2 step operation or a second resource type for an SQS queue policy? |
For anyone who is looking for a quick workaround, we came up with the following. Obviously its not terribly clean to have it as a stack but it will at least preserve the dependency tree:
|
I think this issue may be resolved by #8657 released in v0.7.3 |
Correct @conorgil Do let us know if you have any issues with this new resource. |
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. |
Moving from thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/terraform-tool/Pw6Ffuw1Muc
SQS policies require the 'Resource' value to be set to their own ARN, which doesn't exist until after the SQS is created. Because of this it's not possible to create a policy attached to an SQS with Terraform, either with an inline policy using ${self.arn} or rendered from a template resource as both result in circular dependencies.
From @phinze "...from a brief look at the code it looks like we just need to avoid setting the Policy attribute during our call to CreateQueue, instead delaying it for a subsequent SetQueueAttributes call."
The text was updated successfully, but these errors were encountered: