Skip to content
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

resource/aws_sqs_queue: Retry queue creation on QueueDeletedRecently error #3113

Merged
merged 1 commit into from
Jan 25, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 23, 2018

Closes #831

Failing test before implementation:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSSQSQueue_queueDeletedRecently'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSSQSQueue_queueDeletedRecently -timeout 120m
=== RUN   TestAccAWSSQSQueue_queueDeletedRecently
--- FAIL: TestAccAWSSQSQueue_queueDeletedRecently (14.98s)
	testing.go:513: Step 2 error: Error applying: 1 error(s) occurred:

		* aws_sqs_queue.queue: 1 error(s) occurred:

		* aws_sqs_queue.queue: Error creating SQS queue: AWS.SimpleQueueService.QueueDeletedRecently: You must wait 60 seconds after deleting a queue before you can create another with the same name.
			status code: 400, request id: 8f81b2fe-c49a-5819-abb2-e01f98ce0b03
FAIL
exit status 1
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	15.024s
make: *** [testacc] Error 1

Passing test after implementation:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSSQSQueue_queueDeletedRecently'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSSQSQueue_queueDeletedRecently -timeout 120m
=== RUN   TestAccAWSSQSQueue_queueDeletedRecently
--- PASS: TestAccAWSSQSQueue_queueDeletedRecently (83.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	83.572s

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/sqs Issues and PRs that pertain to the sqs service. labels Jan 23, 2018
@bflad bflad added this to the v1.8.0 milestone Jan 23, 2018
@bflad bflad requested a review from radeksimko January 23, 2018 16:09
var err error
output, err = sqsconn.CreateQueue(req)
if err != nil {
if isAWSErr(err, sqs.ErrCodeQueueDeletedRecently, "You must wait 60 seconds after deleting a queue before you can create another with the same name.") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but I'd perhaps loosen the match here a little bit, just in case they raise the limit from 60 secs, i.e.

after deleting a queue before you can create another with the same name.

or maybe even

You must wait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they change the limit, then we should adjust our retry threshold to match it. Our daily acceptance testing will start failing since this conditional will always return a NonRetryableError

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very good point 👌 - ignore me then! 😅

@bflad bflad merged commit 5770d3e into master Jan 25, 2018
@bflad bflad deleted the f-aws_sqs_queue-queue-deleted-recently branch January 25, 2018 17:28
bflad added a commit that referenced this pull request Jan 25, 2018
@bflad
Copy link
Contributor Author

bflad commented Jan 29, 2018

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.

@ghost
Copy link

ghost commented Apr 8, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sqs Issues and PRs that pertain to the sqs service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQS recreate fails due to required AWS timeout
2 participants