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

Fix suppressEquivalentSnsTopicSubscriptionDeliveryPolicy #14255

Merged
merged 2 commits into from
Feb 25, 2021

Conversation

shuheiktgw
Copy link
Collaborator

@shuheiktgw shuheiktgw commented Jul 20, 2020

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 OR Closes #14041

Release note for CHANGELOG:

resource/aws_sns_topic_subscription: Ensure `delivery_policy` is compared properly during plans (https://github.com/terraform-providers/terraform-provider-aws/pull/14255)

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy -timeout 120m
=== RUN   TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy
--- PASS: TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy (0.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1.639s
...

suppressEquivalentSnsTopicSubscriptionDeliveryPolicy method compared a normalized delivery_policy with a "raw" delivery_policy and check if diffs existed. As a result, unnecessary diffs showed up. So I fixed the method so that it always compare a normalized new delivery_policy with a normalized old delivery_policy.

@shuheiktgw shuheiktgw requested a review from a team July 20, 2020 23:12
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/sns Issues and PRs that pertain to the sns service. needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 20, 2020
Base automatically changed from master to main January 23, 2021 00:58
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:58
@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Feb 25, 2021
@YakDriver YakDriver self-assigned this Feb 25, 2021
@YakDriver YakDriver force-pushed the fix_sns_topic_subscription branch from ba59a3f to e53c813 Compare February 25, 2021 17:43
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Looks great! 🎉

Acceptance tests of GovCloud:

--- PASS: TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy (0.00s)

--- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (1.26s)
--- SKIP: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (1.26s)
--- PASS: TestAccAWSSNSTopicSubscription_email (18.89s)
--- PASS: TestAccAWSSNSTopicSubscription_basic (22.52s)
--- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (48.40s)
--- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (48.88s)
--- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (49.94s)
--- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (52.86s)
--- SKIP: TestAccAWSSNSTopicSubscription_firehose (58.42s)

On us-west-2:

--- PASS: TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy (0.00s)

--- PASS: TestAccAWSSNSTopicSubscription_email (15.61s)
--- PASS: TestAccAWSSNSTopicSubscription_basic (18.41s)
--- PASS: TestAccAWSSNSTopicSubscription_rawMessageDelivery (37.36s)
--- PASS: TestAccAWSSNSTopicSubscription_filterPolicy (37.91s)
--- PASS: TestAccAWSSNSTopicSubscription_deliveryPolicy (38.22s)
--- PASS: TestAccAWSSNSTopicSubscription_redrivePolicy (41.30s)
--- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (55.72s)
--- PASS: TestAccAWSSNSTopicSubscription_firehose (79.92s)
--- PASS: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (88.39s)

@YakDriver YakDriver added this to the v3.30.0 milestone Feb 25, 2021
@YakDriver YakDriver merged commit 9b30c88 into hashicorp:main Feb 25, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

This has been released in version 3.30.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 28, 2021

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 as resolved and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/sns Issues and PRs that pertain to the sns service. size/S 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
Development

Successfully merging this pull request may close these issues.

SNS-HTTPS subscription with delivery policy always shows up in plan
2 participants