-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
add resource aws_sqs_queue_redrive_policy #26733
add resource aws_sqs_queue_redrive_policy #26733
Conversation
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.
Welcome @mlund01 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
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.
Looks good, thanks for taking the time to review and update @ewbankkit
… yaml: line 7: could not find expected ':'".
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.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccSQSQueuePolicy_' PKG=sqs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 2 -run=TestAccSQSQueuePolicy_ -timeout 180m
=== RUN TestAccSQSQueuePolicy_basic
=== PAUSE TestAccSQSQueuePolicy_basic
=== RUN TestAccSQSQueuePolicy_disappears
=== PAUSE TestAccSQSQueuePolicy_disappears
=== RUN TestAccSQSQueuePolicy_Disappears_queue
=== PAUSE TestAccSQSQueuePolicy_Disappears_queue
=== RUN TestAccSQSQueuePolicy_update
=== PAUSE TestAccSQSQueuePolicy_update
=== CONT TestAccSQSQueuePolicy_basic
=== CONT TestAccSQSQueuePolicy_Disappears_queue
--- PASS: TestAccSQSQueuePolicy_basic (108.21s)
=== CONT TestAccSQSQueuePolicy_update
--- PASS: TestAccSQSQueuePolicy_Disappears_queue (108.84s)
=== CONT TestAccSQSQueuePolicy_disappears
--- PASS: TestAccSQSQueuePolicy_disappears (114.13s)
--- PASS: TestAccSQSQueuePolicy_update (135.74s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sqs 247.922s
% make testacc TESTARGS='-run=TestAccSQSQueueRedrivePolicy_' PKG=sqs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 2 -run=TestAccSQSQueueRedrivePolicy_ -timeout 180m
=== RUN TestAccSQSQueueRedrivePolicy_basic
=== PAUSE TestAccSQSQueueRedrivePolicy_basic
=== RUN TestAccSQSQueueRedrivePolicy_disappears
=== PAUSE TestAccSQSQueueRedrivePolicy_disappears
=== RUN TestAccSQSQueueRedrivePolicy_Disappears_queue
=== PAUSE TestAccSQSQueueRedrivePolicy_Disappears_queue
=== RUN TestAccSQSQueueRedrivePolicy_update
=== PAUSE TestAccSQSQueueRedrivePolicy_update
=== CONT TestAccSQSQueueRedrivePolicy_basic
=== CONT TestAccSQSQueueRedrivePolicy_Disappears_queue
--- PASS: TestAccSQSQueueRedrivePolicy_basic (136.50s)
=== CONT TestAccSQSQueueRedrivePolicy_update
--- PASS: TestAccSQSQueueRedrivePolicy_Disappears_queue (139.63s)
=== CONT TestAccSQSQueueRedrivePolicy_disappears
--- PASS: TestAccSQSQueueRedrivePolicy_disappears (144.67s)
--- PASS: TestAccSQSQueueRedrivePolicy_update (164.81s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sqs 305.182s
% make testacc TESTARGS='-run=TestAccSQSQueueRedriveAllowPolicy_' PKG=sqs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 2 -run=TestAccSQSQueueRedriveAllowPolicy_ -timeout 180m
=== RUN TestAccSQSQueueRedriveAllowPolicy_basic
=== PAUSE TestAccSQSQueueRedriveAllowPolicy_basic
=== RUN TestAccSQSQueueRedriveAllowPolicy_disappears
=== PAUSE TestAccSQSQueueRedriveAllowPolicy_disappears
=== RUN TestAccSQSQueueRedriveAllowPolicy_Disappears_queue
=== PAUSE TestAccSQSQueueRedriveAllowPolicy_Disappears_queue
=== RUN TestAccSQSQueueRedriveAllowPolicy_update
=== PAUSE TestAccSQSQueueRedriveAllowPolicy_update
=== CONT TestAccSQSQueueRedriveAllowPolicy_basic
=== CONT TestAccSQSQueueRedriveAllowPolicy_Disappears_queue
--- PASS: TestAccSQSQueueRedriveAllowPolicy_basic (138.23s)
=== CONT TestAccSQSQueueRedriveAllowPolicy_disappears
--- PASS: TestAccSQSQueueRedriveAllowPolicy_Disappears_queue (138.92s)
=== CONT TestAccSQSQueueRedriveAllowPolicy_update
--- PASS: TestAccSQSQueueRedriveAllowPolicy_disappears (144.32s)
--- PASS: TestAccSQSQueueRedriveAllowPolicy_update (162.29s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sqs 305.148s
% make testacc TESTARGS='-run=TestAccSQSQueueDataSource_\|TestAccSQSQueue_' PKG=sqs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 2 -run=TestAccSQSQueueDataSource_\|TestAccSQSQueue_ -timeout 180m
=== RUN TestAccSQSQueueDataSource_basic
=== PAUSE TestAccSQSQueueDataSource_basic
=== RUN TestAccSQSQueueDataSource_tags
=== PAUSE TestAccSQSQueueDataSource_tags
=== RUN TestAccSQSQueue_basic
=== PAUSE TestAccSQSQueue_basic
=== RUN TestAccSQSQueue_disappears
=== PAUSE TestAccSQSQueue_disappears
=== RUN TestAccSQSQueue_Name_generated
=== PAUSE TestAccSQSQueue_Name_generated
=== RUN TestAccSQSQueue_NameGenerated_fifoQueue
=== PAUSE TestAccSQSQueue_NameGenerated_fifoQueue
=== RUN TestAccSQSQueue_namePrefix
=== PAUSE TestAccSQSQueue_namePrefix
=== RUN TestAccSQSQueue_NamePrefix_fifoQueue
=== PAUSE TestAccSQSQueue_NamePrefix_fifoQueue
=== RUN TestAccSQSQueue_tags
=== PAUSE TestAccSQSQueue_tags
=== RUN TestAccSQSQueue_update
=== PAUSE TestAccSQSQueue_update
=== RUN TestAccSQSQueue_Policy_basic
=== PAUSE TestAccSQSQueue_Policy_basic
=== RUN TestAccSQSQueue_Policy_ignoreEquivalent
=== PAUSE TestAccSQSQueue_Policy_ignoreEquivalent
=== RUN TestAccSQSQueue_recentlyDeleted
=== PAUSE TestAccSQSQueue_recentlyDeleted
=== RUN TestAccSQSQueue_redrivePolicy
=== PAUSE TestAccSQSQueue_redrivePolicy
=== RUN TestAccSQSQueue_redriveAllowPolicy
=== PAUSE TestAccSQSQueue_redriveAllowPolicy
=== RUN TestAccSQSQueue_fifoQueue
=== PAUSE TestAccSQSQueue_fifoQueue
=== RUN TestAccSQSQueue_FIFOQueue_expectNameError
=== PAUSE TestAccSQSQueue_FIFOQueue_expectNameError
=== RUN TestAccSQSQueue_FIFOQueue_contentBasedDeduplication
=== PAUSE TestAccSQSQueue_FIFOQueue_contentBasedDeduplication
=== RUN TestAccSQSQueue_FIFOQueue_highThroughputMode
=== PAUSE TestAccSQSQueue_FIFOQueue_highThroughputMode
=== RUN TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError
=== PAUSE TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError
=== RUN TestAccSQSQueue_encryption
=== PAUSE TestAccSQSQueue_encryption
=== RUN TestAccSQSQueue_zeroVisibilityTimeoutSeconds
=== PAUSE TestAccSQSQueue_zeroVisibilityTimeoutSeconds
=== RUN TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds
=== PAUSE TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds
=== CONT TestAccSQSQueueDataSource_basic
=== CONT TestAccSQSQueue_recentlyDeleted
--- PASS: TestAccSQSQueueDataSource_basic (45.48s)
=== CONT TestAccSQSQueue_namePrefix
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-prefix-20220913133558004500000004 still exists
--- FAIL: TestAccSQSQueue_namePrefix (45.45s)
=== CONT TestAccSQSQueue_Policy_ignoreEquivalent
=== CONT TestAccSQSQueue_recentlyDeleted
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-5291812223422315905 still exists
--- FAIL: TestAccSQSQueue_recentlyDeleted (141.20s)
=== CONT TestAccSQSQueue_Policy_basic
--- PASS: TestAccSQSQueue_Policy_ignoreEquivalent (101.21s)
=== CONT TestAccSQSQueue_update
--- PASS: TestAccSQSQueue_Policy_basic (94.89s)
=== CONT TestAccSQSQueue_tags
--- PASS: TestAccSQSQueue_update (83.72s)
=== CONT TestAccSQSQueue_NamePrefix_fifoQueue
=== CONT TestAccSQSQueue_tags
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-1897314527937579916 still exists
--- FAIL: TestAccSQSQueue_tags (67.99s)
=== CONT TestAccSQSQueue_FIFOQueue_highThroughputMode
=== CONT TestAccSQSQueue_NamePrefix_fifoQueue
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-prefix-20220913133948402900000008.fifo still exists
--- FAIL: TestAccSQSQueue_NamePrefix_fifoQueue (46.25s)
=== CONT TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-8278462624834602555 still exists
--- FAIL: TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds (44.94s)
=== CONT TestAccSQSQueue_zeroVisibilityTimeoutSeconds
=== CONT TestAccSQSQueue_FIFOQueue_highThroughputMode
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-4983630808639157017.fifo still exists
--- FAIL: TestAccSQSQueue_FIFOQueue_highThroughputMode (83.31s)
=== CONT TestAccSQSQueue_encryption
=== CONT TestAccSQSQueue_zeroVisibilityTimeoutSeconds
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-3294804985754665186 still exists
--- FAIL: TestAccSQSQueue_zeroVisibilityTimeoutSeconds (44.84s)
=== CONT TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError
--- PASS: TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError (2.01s)
=== CONT TestAccSQSQueue_disappears
--- PASS: TestAccSQSQueue_disappears (59.88s)
=== CONT TestAccSQSQueue_NameGenerated_fifoQueue
=== CONT TestAccSQSQueue_encryption
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-8686378499255522412 still exists
--- FAIL: TestAccSQSQueue_encryption (120.21s)
=== CONT TestAccSQSQueue_Name_generated
--- PASS: TestAccSQSQueue_NameGenerated_fifoQueue (44.70s)
=== CONT TestAccSQSQueue_fifoQueue
=== CONT TestAccSQSQueue_Name_generated
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/terraform-20220913134340041300000010 still exists
--- FAIL: TestAccSQSQueue_Name_generated (44.98s)
=== CONT TestAccSQSQueue_FIFOQueue_contentBasedDeduplication
=== CONT TestAccSQSQueue_fifoQueue
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-547316892527749503.fifo still exists
--- FAIL: TestAccSQSQueue_fifoQueue (46.14s)
=== CONT TestAccSQSQueue_FIFOQueue_expectNameError
--- PASS: TestAccSQSQueue_FIFOQueue_expectNameError (1.95s)
=== CONT TestAccSQSQueue_basic
=== CONT TestAccSQSQueue_FIFOQueue_contentBasedDeduplication
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-4229132132419062898.fifo still exists
--- FAIL: TestAccSQSQueue_FIFOQueue_contentBasedDeduplication (45.33s)
=== CONT TestAccSQSQueueDataSource_tags
=== CONT TestAccSQSQueue_basic
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-4076105577281736534 still exists
--- FAIL: TestAccSQSQueue_basic (44.68s)
=== CONT TestAccSQSQueue_redriveAllowPolicy
--- PASS: TestAccSQSQueueDataSource_tags (43.75s)
=== CONT TestAccSQSQueue_redrivePolicy
=== CONT TestAccSQSQueue_redriveAllowPolicy
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-802405050527071055-1 still exists
--- FAIL: TestAccSQSQueue_redriveAllowPolicy (75.73s)
=== CONT TestAccSQSQueue_redrivePolicy
testing_new.go:84: Error running post-test destroy, there may be dangling resources: SQS Queue https://sqs.us-west-2.amazonaws.com/123456789012/tf-acc-test-270655400837734910-1 still exists
--- FAIL: TestAccSQSQueue_redrivePolicy (74.18s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/sqs 719.759s
FAIL
make: *** [testacc] Error 1
The failures are unrelated are this changes and occur in CI; something to do with eventual consistency.
@mlund01 Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.31.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #22577
This PR adds the resource
aws_sqs_queue_redrive_policy
, which allows you to create a redrive policy after an existing sqs queue. Read more in #22577 on why this is needed.The internals of this resource are nearly identical to the
aws_sqs_queue_policy
resource, with a few small exceptions. For this reason, I created a function generator that the CRUD functions utilize, reusing most of the function definitions from theaws_sqs_queue_policy
CRUD methods, with a few exceptions. The function generators are inattribute_funcs
file within the sqs package. For this reason, I have also listed the output of theaws_sqs_queue_policy
resource tests below.Additional note, by creating this as a shared function and using the latest context-based methods, this also updates the
aws_sqs_queue_policy
resource to use the context CRUD methods.Output from acceptance testing: