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

Add SignatureVersion support to sns topics. #29462

Merged
merged 4 commits into from
Feb 21, 2023

Conversation

Manouchehri
Copy link
Contributor

Description

This pull request adds support for the SignatureVersion attribute to the aws_sns_topic resource in the AWS provider. The SignatureVersion attribute allows users to specify the version of the signature used to verify messages published to the topic.

Relations

Closes #28576

References

https://aws.amazon.com/blogs/security/sign-amazon-sns-messages-with-sha256-hashing-for-http-subscriptions/

Output from Acceptance Testing

$ make testacc TESTS=TestAccSNSTopic PKG=sns

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/... -v -count=1 -run=TestAccSNSTopic
=== RUN TestAccSNSTopic
aws_sns_topic.test_topic: Creating...
aws_sns_topic.test_topic: Creation complete after 1s [id=arn:aws:sns:us-west-2:123456789012:test_topic]
--- PASS: TestAccSNSTopic (8.21s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 8.211s

@github-actions
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/sns Issues and PRs that pertain to the sns service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 17, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @Manouchehri 👋

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! 😃

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Feb 18, 2023
Acceptance test output:

% make testacc TESTARGS='-run=TestAccSNSTopic_' PKG=sns ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sns/... -v -count 1 -parallel 3  -run=TestAccSNSTopic_ -timeout 180m
=== RUN   TestAccSNSTopic_basic
=== PAUSE TestAccSNSTopic_basic
=== RUN   TestAccSNSTopic_disappears
=== PAUSE TestAccSNSTopic_disappears
=== RUN   TestAccSNSTopic_name
=== PAUSE TestAccSNSTopic_name
=== RUN   TestAccSNSTopic_namePrefix
=== PAUSE TestAccSNSTopic_namePrefix
=== RUN   TestAccSNSTopic_tags
=== PAUSE TestAccSNSTopic_tags
=== RUN   TestAccSNSTopic_policy
=== PAUSE TestAccSNSTopic_policy
=== RUN   TestAccSNSTopic_withIAMRole
=== PAUSE TestAccSNSTopic_withIAMRole
=== RUN   TestAccSNSTopic_withFakeIAMRole
=== PAUSE TestAccSNSTopic_withFakeIAMRole
=== RUN   TestAccSNSTopic_withDeliveryPolicy
=== PAUSE TestAccSNSTopic_withDeliveryPolicy
=== RUN   TestAccSNSTopic_deliveryStatus
=== PAUSE TestAccSNSTopic_deliveryStatus
=== RUN   TestAccSNSTopic_NameGenerated_fifoTopic
=== PAUSE TestAccSNSTopic_NameGenerated_fifoTopic
=== RUN   TestAccSNSTopic_Name_fifoTopic
=== PAUSE TestAccSNSTopic_Name_fifoTopic
=== RUN   TestAccSNSTopic_NamePrefix_fifoTopic
=== PAUSE TestAccSNSTopic_NamePrefix_fifoTopic
=== RUN   TestAccSNSTopic_fifoWithContentBasedDeduplication
=== PAUSE TestAccSNSTopic_fifoWithContentBasedDeduplication
=== RUN   TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
=== PAUSE TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
=== RUN   TestAccSNSTopic_encryption
=== PAUSE TestAccSNSTopic_encryption
=== CONT  TestAccSNSTopic_basic
=== CONT  TestAccSNSTopic_withDeliveryPolicy
=== CONT  TestAccSNSTopic_NamePrefix_fifoTopic
--- PASS: TestAccSNSTopic_basic (22.46s)
=== CONT  TestAccSNSTopic_NameGenerated_fifoTopic
--- PASS: TestAccSNSTopic_NamePrefix_fifoTopic (22.59s)
=== CONT  TestAccSNSTopic_Name_fifoTopic
--- PASS: TestAccSNSTopic_withDeliveryPolicy (22.73s)
=== CONT  TestAccSNSTopic_deliveryStatus
--- PASS: TestAccSNSTopic_NameGenerated_fifoTopic (19.02s)
=== CONT  TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
--- PASS: TestAccSNSTopic_Name_fifoTopic (19.09s)
=== CONT  TestAccSNSTopic_encryption
--- PASS: TestAccSNSTopic_fifoExpectContentBasedDeduplicationError (2.33s)
=== CONT  TestAccSNSTopic_fifoWithContentBasedDeduplication
--- PASS: TestAccSNSTopic_deliveryStatus (42.40s)
=== CONT  TestAccSNSTopic_tags
--- PASS: TestAccSNSTopic_encryption (34.65s)
=== CONT  TestAccSNSTopic_withFakeIAMRole
--- PASS: TestAccSNSTopic_fifoWithContentBasedDeduplication (34.82s)
=== CONT  TestAccSNSTopic_withIAMRole
--- PASS: TestAccSNSTopic_withIAMRole (31.46s)
=== CONT  TestAccSNSTopic_policy
--- PASS: TestAccSNSTopic_tags (45.94s)
=== CONT  TestAccSNSTopic_name
--- PASS: TestAccSNSTopic_policy (20.82s)
=== CONT  TestAccSNSTopic_namePrefix
--- PASS: TestAccSNSTopic_name (19.99s)
=== CONT  TestAccSNSTopic_disappears
--- PASS: TestAccSNSTopic_disappears (15.11s)
--- PASS: TestAccSNSTopic_namePrefix (20.95s)
--- PASS: TestAccSNSTopic_withFakeIAMRole (129.76s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sns	211.654s
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Feb 21, 2023
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 TESTARGS='-run=TestAccSNSTopic_' PKG=sns ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sns/... -v -count 1 -parallel 3  -run=TestAccSNSTopic_ -timeout 180m
=== RUN   TestAccSNSTopic_basic
=== PAUSE TestAccSNSTopic_basic
=== RUN   TestAccSNSTopic_disappears
=== PAUSE TestAccSNSTopic_disappears
=== RUN   TestAccSNSTopic_name
=== PAUSE TestAccSNSTopic_name
=== RUN   TestAccSNSTopic_namePrefix
=== PAUSE TestAccSNSTopic_namePrefix
=== RUN   TestAccSNSTopic_tags
=== PAUSE TestAccSNSTopic_tags
=== RUN   TestAccSNSTopic_policy
=== PAUSE TestAccSNSTopic_policy
=== RUN   TestAccSNSTopic_withIAMRole
=== PAUSE TestAccSNSTopic_withIAMRole
=== RUN   TestAccSNSTopic_withFakeIAMRole
=== PAUSE TestAccSNSTopic_withFakeIAMRole
=== RUN   TestAccSNSTopic_withDeliveryPolicy
=== PAUSE TestAccSNSTopic_withDeliveryPolicy
=== RUN   TestAccSNSTopic_deliveryStatus
=== PAUSE TestAccSNSTopic_deliveryStatus
=== RUN   TestAccSNSTopic_NameGenerated_fifoTopic
=== PAUSE TestAccSNSTopic_NameGenerated_fifoTopic
=== RUN   TestAccSNSTopic_Name_fifoTopic
=== PAUSE TestAccSNSTopic_Name_fifoTopic
=== RUN   TestAccSNSTopic_NamePrefix_fifoTopic
=== PAUSE TestAccSNSTopic_NamePrefix_fifoTopic
=== RUN   TestAccSNSTopic_fifoWithContentBasedDeduplication
=== PAUSE TestAccSNSTopic_fifoWithContentBasedDeduplication
=== RUN   TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
=== PAUSE TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
=== RUN   TestAccSNSTopic_encryption
=== PAUSE TestAccSNSTopic_encryption
=== CONT  TestAccSNSTopic_basic
=== CONT  TestAccSNSTopic_withDeliveryPolicy
=== CONT  TestAccSNSTopic_NamePrefix_fifoTopic
--- PASS: TestAccSNSTopic_basic (22.46s)
=== CONT  TestAccSNSTopic_NameGenerated_fifoTopic
--- PASS: TestAccSNSTopic_NamePrefix_fifoTopic (22.59s)
=== CONT  TestAccSNSTopic_Name_fifoTopic
--- PASS: TestAccSNSTopic_withDeliveryPolicy (22.73s)
=== CONT  TestAccSNSTopic_deliveryStatus
--- PASS: TestAccSNSTopic_NameGenerated_fifoTopic (19.02s)
=== CONT  TestAccSNSTopic_fifoExpectContentBasedDeduplicationError
--- PASS: TestAccSNSTopic_Name_fifoTopic (19.09s)
=== CONT  TestAccSNSTopic_encryption
--- PASS: TestAccSNSTopic_fifoExpectContentBasedDeduplicationError (2.33s)
=== CONT  TestAccSNSTopic_fifoWithContentBasedDeduplication
--- PASS: TestAccSNSTopic_deliveryStatus (42.40s)
=== CONT  TestAccSNSTopic_tags
--- PASS: TestAccSNSTopic_encryption (34.65s)
=== CONT  TestAccSNSTopic_withFakeIAMRole
--- PASS: TestAccSNSTopic_fifoWithContentBasedDeduplication (34.82s)
=== CONT  TestAccSNSTopic_withIAMRole
--- PASS: TestAccSNSTopic_withIAMRole (31.46s)
=== CONT  TestAccSNSTopic_policy
--- PASS: TestAccSNSTopic_tags (45.94s)
=== CONT  TestAccSNSTopic_name
--- PASS: TestAccSNSTopic_policy (20.82s)
=== CONT  TestAccSNSTopic_namePrefix
--- PASS: TestAccSNSTopic_name (19.99s)
=== CONT  TestAccSNSTopic_disappears
--- PASS: TestAccSNSTopic_disappears (15.11s)
--- PASS: TestAccSNSTopic_namePrefix (20.95s)
--- PASS: TestAccSNSTopic_withFakeIAMRole (129.76s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sns	211.654s

@ewbankkit
Copy link
Contributor

ewbankkit commented Feb 21, 2023

@Manouchehri Thanks for the contribution 🎉 👏.

In general everything was great. I change the new attribute to Computed for backwards compatibility as for existing topics no SignatureVersion is returned (even though the docs say the default is 1).

@Manouchehri
Copy link
Contributor Author

Oh, good catch! That was my bad for believing the documentation. =P

Looks good to me then, thanks!

@ewbankkit ewbankkit merged commit 96ab862 into hashicorp:main Feb 21, 2023
@github-actions github-actions bot added this to the v4.56.0 milestone Feb 21, 2023
@github-actions
Copy link

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

@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 Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. 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.

[Enhancement]: Missing SignatureVersion attribute of SNS topic resource
2 participants