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

sqs: Fix diffs with policies #22194

Merged
merged 15 commits into from
Dec 14, 2021
Merged

sqs: Fix diffs with policies #22194

merged 15 commits into from
Dec 14, 2021

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Dec 13, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #21968
Fixes #19836
Fixes #20333

NOTE: These changes will make SQS configurations take a little longer to apply. However, because SQS has such trouble with eventual consistency, the extra time is needed to improve consistency.

I ran each test 10X in 3 different regions. Unfortunately, these changes do not perfectly fix all eventual consistency problems (see #19836 and #20333). However, the overall improvement is significant:

Test GovCloud us-west-2 us-east-1
Total Out of 260 (before --> after) 182 --> 258 255 --> 259 258 --> 258
TestAccSQSQueue_basic 9 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds 6 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_disappears 8 --> 10 10 --> 9 10 --> 10
TestAccSQSQueue_encryption 2 --> 10 9 --> 10 10 --> 10
TestAccSQSQueue_fifoQueue 7 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_FIFOQueue_contentBasedDeduplication 8 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_FIFOQueue_expectNameError 10 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_FIFOQueue_highThroughputMode 6 --> 10 9 --> 10 10 --> 10
TestAccSQSQueue_Name_generated 9 --> 10 10 --> 10 10 --> 9
TestAccSQSQueue_NameGenerated_fifoQueue 7 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_namePrefix 9 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_NamePrefix_fifoQueue 10 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_Policy_basic 10 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_Policy_ignoreEquivalent 10 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_recentlyDeleted 7 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_redrivePolicy 7 --> 10 9 --> 10 10 --> 10
TestAccSQSQueue_StandardQueue_expectContentBased... 10 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_tags 6 --> 10 9 --> 10 10 --> 10
TestAccSQSQueue_update 3 --> 10 10 --> 10 10 --> 10
TestAccSQSQueue_zeroVisibilityTimeoutSeconds 7 --> 10 10 --> 10 10 --> 9
TestAccSQSQueueDataSource_basic 6 --> 9 10 --> 10 10 --> 10
TestAccSQSQueueDataSource_tags 7 --> 10 10 --> 10 10 --> 10
TestAccSQSQueuePolicy_basic 2 --> 10 9 --> 10 9 --> 10
TestAccSQSQueuePolicy_disappears 3 --> 10 10 --> 10 10 --> 10
TestAccSQSQueuePolicy_Disappears_queue 8 --> 9 10 --> 10 10 --> 10
TestAccSQSQueuePolicy_update 5 --> 10 10 --> 10 9 --> 10

Output from acceptance testing (us-west-2):

% make testacc TESTS=TestAccSQSQueue PKG=sqs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 20 -run='TestAccSQSQueue' -timeout 180m
--- PASS: TestAccSQSQueue_FIFOQueue_expectNameError (5.24s)
--- PASS: TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError (5.43s)
--- PASS: TestAccSQSQueue_NamePrefix_fifoQueue (49.23s)
--- PASS: TestAccSQSQueueDataSource_basic (49.52s)
--- PASS: TestAccSQSQueue_fifoQueue (52.91s)
--- PASS: TestAccSQSQueue_zeroVisibilityTimeoutSeconds (53.05s)
--- PASS: TestAccSQSQueue_FIFOQueue_contentBasedDeduplication (53.19s)
--- PASS: TestAccSQSQueue_NameGenerated_fifoQueue (53.24s)
--- PASS: TestAccSQSQueue_basic (53.24s)
--- PASS: TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds (53.31s)
--- PASS: TestAccSQSQueue_namePrefix (53.33s)
--- PASS: TestAccSQSQueue_Name_generated (53.33s)
--- PASS: TestAccSQSQueue_disappears (58.84s)
--- PASS: TestAccSQSQueue_redrivePolicy (67.99s)
--- PASS: TestAccSQSQueue_tags (75.07s)
--- PASS: TestAccSQSQueue_update (79.35s)
--- PASS: TestAccSQSQueue_FIFOQueue_highThroughputMode (79.66s)
--- PASS: TestAccSQSQueueDataSource_tags (37.40s)
--- PASS: TestAccSQSQueuePolicy_Disappears_queue (90.95s)
--- PASS: TestAccSQSQueue_Policy_ignoreEquivalent (93.70s)
--- PASS: TestAccSQSQueuePolicy_update (102.57s)
--- PASS: TestAccSQSQueue_encryption (104.95s)
--- PASS: TestAccSQSQueuePolicy_basic (73.36s)
--- PASS: TestAccSQSQueue_recentlyDeleted (123.80s)
--- PASS: TestAccSQSQueuePolicy_disappears (83.69s)
--- PASS: TestAccSQSQueue_Policy_basic (87.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sqs	138.023s

Output from acceptance testing (GovCloud):

% make testacc TESTS=TestAccSQSQueue PKG=sqs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 20 -run='TestAccSQSQueue' -timeout 180m
--- PASS: TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError (6.27s)
--- PASS: TestAccSQSQueue_FIFOQueue_expectNameError (6.43s)
--- PASS: TestAccSQSQueue_fifoQueue (51.83s)
--- PASS: TestAccSQSQueue_Name_generated (75.05s)
--- PASS: TestAccSQSQueue_Policy_ignoreEquivalent (100.83s)
--- PASS: TestAccSQSQueue_Policy_basic (95.58s)
--- PASS: TestAccSQSQueue_FIFOQueue_contentBasedDeduplication (103.79s)
--- PASS: TestAccSQSQueue_zeroVisibilityTimeoutSeconds (105.19s)
--- PASS: TestAccSQSQueue_basic (112.31s)
--- PASS: TestAccSQSQueue_disappears (116.04s)
--- PASS: TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds (117.01s)
--- PASS: TestAccSQSQueue_redrivePolicy (127.00s)
--- PASS: TestAccSQSQueuePolicy_update (134.62s)
--- PASS: TestAccSQSQueuePolicy_basic (139.97s)
--- PASS: TestAccSQSQueuePolicy_disappears (143.00s)
--- PASS: TestAccSQSQueuePolicy_Disappears_queue (146.17s)
--- PASS: TestAccSQSQueueDataSource_tags (153.68s)
--- PASS: TestAccSQSQueueDataSource_basic (158.34s)
--- PASS: TestAccSQSQueue_update (154.88s)
--- PASS: TestAccSQSQueue_FIFOQueue_highThroughputMode (162.26s)
--- PASS: TestAccSQSQueue_encryption (164.73s)
--- PASS: TestAccSQSQueue_NamePrefix_fifoQueue (102.71s)
--- PASS: TestAccSQSQueue_namePrefix (97.73s)
--- PASS: TestAccSQSQueue_NameGenerated_fifoQueue (103.07s)
--- PASS: TestAccSQSQueue_recentlyDeleted (210.20s)
--- PASS: TestAccSQSQueue_tags (182.22s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sqs	235.349s

@github-actions github-actions bot added service/sqs Issues and PRs that pertain to the sqs service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. labels Dec 13, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTS=TestAccSQSQueue_ PKG=sqs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sqs/... -v -count 1 -parallel 20 -run='TestAccSQSQueue_' -timeout 180m
=== 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_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  TestAccSQSQueue_basic
=== CONT  TestAccSQSQueue_redrivePolicy
=== CONT  TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError
=== CONT  TestAccSQSQueue_FIFOQueue_highThroughputMode
=== CONT  TestAccSQSQueue_encryption
=== CONT  TestAccSQSQueue_disappears
=== CONT  TestAccSQSQueue_FIFOQueue_contentBasedDeduplication
=== CONT  TestAccSQSQueue_FIFOQueue_expectNameError
=== CONT  TestAccSQSQueue_fifoQueue
=== CONT  TestAccSQSQueue_tags
=== CONT  TestAccSQSQueue_recentlyDeleted
=== CONT  TestAccSQSQueue_Policy_ignoreEquivalent
=== CONT  TestAccSQSQueue_Policy_basic
=== CONT  TestAccSQSQueue_update
=== CONT  TestAccSQSQueue_NameGenerated_fifoQueue
=== CONT  TestAccSQSQueue_NamePrefix_fifoQueue
=== CONT  TestAccSQSQueue_zeroVisibilityTimeoutSeconds
=== CONT  TestAccSQSQueue_namePrefix
=== CONT  TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds
=== CONT  TestAccSQSQueue_Name_generated
--- PASS: TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError (7.66s)
--- PASS: TestAccSQSQueue_FIFOQueue_expectNameError (8.02s)
--- PASS: TestAccSQSQueue_disappears (31.96s)
--- PASS: TestAccSQSQueue_zeroVisibilityTimeoutSeconds (40.56s)
--- PASS: TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds (44.24s)
--- PASS: TestAccSQSQueue_Name_generated (44.38s)
--- PASS: TestAccSQSQueue_NameGenerated_fifoQueue (44.38s)
--- PASS: TestAccSQSQueue_basic (44.40s)
--- PASS: TestAccSQSQueue_NamePrefix_fifoQueue (44.45s)
--- PASS: TestAccSQSQueue_FIFOQueue_contentBasedDeduplication (44.63s)
--- PASS: TestAccSQSQueue_fifoQueue (44.68s)
--- PASS: TestAccSQSQueue_namePrefix (44.80s)
--- PASS: TestAccSQSQueue_redrivePolicy (47.10s)
--- PASS: TestAccSQSQueue_update (55.88s)
--- PASS: TestAccSQSQueue_FIFOQueue_highThroughputMode (56.22s)
--- PASS: TestAccSQSQueue_tags (63.90s)
--- PASS: TestAccSQSQueue_encryption (67.10s)
--- PASS: TestAccSQSQueue_Policy_ignoreEquivalent (78.01s)
--- PASS: TestAccSQSQueue_Policy_basic (84.02s)
--- PASS: TestAccSQSQueue_recentlyDeleted (92.32s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sqs	95.919s

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Dec 14, 2021
@YakDriver YakDriver merged commit 37f313b into main Dec 14, 2021
@YakDriver YakDriver deleted the b-sqs-policy-diffs branch December 14, 2021 20:56
@github-actions github-actions bot added this to the v3.70.0 milestone Dec 14, 2021
github-actions bot pushed a commit that referenced this pull request Dec 14, 2021
@github-actions
Copy link

This functionality has been released in v3.70.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!

@joe-a-t
Copy link

joe-a-t commented Jan 10, 2022

This still seems to be an issue with #22197 (comment) even after upgrading to 3.71.0 so we have had to pin to 3.68.0

@zacblazic
Copy link

I'm using v3.71.0 and seeing whitespace diffs for the policy argument when setting it via jsonencode().

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/sqs Issues and PRs that pertain to the sqs service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
4 participants