-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 Queue created without Policy cannot have policy attached #2669
Comments
Aside: For future travelers, the error message in the original issue is a little misleading. We recently updated the resource ID via state migration to drop the @tsholmes Thanks for reporting this! It seems like there might be an eventual consistency issue with SQS queue attributes on creation then immediate read. The SetQueueAttributes API documentation does indeed confirm this is a possibility, since a SQS queue policy is really a
Given this is dependent on AWS factors outside anyone's control, I am guessing we have not run into this too much with the existing acceptance testing. I was only able to reproduce this in 1 time out of a bunch myself. We might be able to do some cursory retry checking in there, which I'll try to add now. |
PR submitted: #2739 |
This is fixed in master and will release with v1.8.0 of the provider! |
Awesome. Thanks @bflad! |
This has been released in terraform-provider-aws version 1.8.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
When attempting to plan a config that attaches a policy to an SQS queue, the plan fails if the SQS queue does not already have a policy attached.
https://github.com/terraform-providers/terraform-provider-aws/blob/8994a3474b02dd6f76cc5ecef2d1cfc6ba2e5def/aws/resource_aws_sqs_queue_policy.go#L79-L82
Terraform Version
0.10.7
aws provider
1.2.0
(but bug still exists in master)Affected Resource(s)
aws_sqs_queue_policy
Terraform Configuration Files
There are a few other resources, but they aren't relevant.
Expected Behavior
The plan succeeds with changes showing the policy being added.
Actual Behavior
The plan fails with
SQS Queue policy not found for sqs-policy-https://sqs.us-west-2.amazonaws.com/NNNNNNNNN/sqs_queue
Steps to Reproduce
The text was updated successfully, but these errors were encountered: