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 aws_shield_protection data source #37524

Merged
merged 21 commits into from
Aug 29, 2024
Merged

add aws_shield_protection data source #37524

merged 21 commits into from
Aug 29, 2024

Conversation

hong-yi
Copy link
Contributor

@hong-yi hong-yi commented May 15, 2024

Description

  • Adds the data source for aws_shield_protection

Relations

Closes #35387

References

https://docs.aws.amazon.com/waf/latest/DDOSAPIReference/API_DescribeProtection.html

Output from Acceptance Testing

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/shield/... -v -count 1 -parallel 20 -run='TestAccShieldProtectionDataSource'  -timeout 360m
=== RUN   TestAccShieldProtectionDataSource_route53HostedZone
=== PAUSE TestAccShieldProtectionDataSource_route53HostedZone
=== RUN   TestAccShieldProtectionDataSource_cloudfront
=== PAUSE TestAccShieldProtectionDataSource_cloudfront
=== RUN   TestAccShieldProtectionDataSource_alb
=== PAUSE TestAccShieldProtectionDataSource_alb
=== RUN   TestAccShieldProtectionDataSource_elasticIPAddress
=== PAUSE TestAccShieldProtectionDataSource_elasticIPAddress
=== RUN   TestAccShieldProtectionDataSource_globalAccelerator
=== PAUSE TestAccShieldProtectionDataSource_globalAccelerator
=== RUN   TestAccShieldProtectionDataSource_elb
=== PAUSE TestAccShieldProtectionDataSource_elb
=== CONT  TestAccShieldProtectionDataSource_route53HostedZone
=== CONT  TestAccShieldProtectionDataSource_elasticIPAddress
=== CONT  TestAccShieldProtectionDataSource_globalAccelerator
=== CONT  TestAccShieldProtectionDataSource_alb
=== CONT  TestAccShieldProtectionDataSource_cloudfront
=== CONT  TestAccShieldProtectionDataSource_elb
=== NAME  TestAccShieldProtectionDataSource_alb
--- PASS: TestAccShieldProtectionDataSource_alb (9.62s)
--- PASS: TestAccShieldProtectionDataSource_elb (9.62s)
--- PASS: TestAccShieldProtectionDataSource_elasticIPAddress (38.17s)
--- PASS: TestAccShieldProtectionDataSource_route53HostedZone (80.02s)
--- PASS: TestAccShieldProtectionDataSource_globalAccelerator (87.08s)
=== NAME  TestAccShieldProtectionDataSource_cloudfront
    protection_data_source_test.go:58: Error running post-test destroy, there may be dangling resources: Shield Protection 054e3dfb-2f98-4759-8c8a-a61049a1c947 still exists
--- FAIL: TestAccShieldProtectionDataSource_cloudfront (199.79s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/shield	207.228s
FAIL

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 size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/shield Issues and PRs that pertain to the shield service. generators Relates to code generators. and removed size/XL Managed by automation to categorize the size of a PR. labels May 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
@justinretzolk justinretzolk added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels May 16, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@hong-yi hong-yi marked this pull request as ready for review May 24, 2024 02:19
@github-actions github-actions bot added the size/XL Managed by automation to categorize the size of a PR. label May 24, 2024
@jar-b jar-b self-assigned this Aug 29, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 29, 2024
The acceptance tests for the corresponding `aws_sheild_protection` resource cover many of the potential resource types which can be passed into the `resource_arn` argument. For the data source, we can reduce the complexity and simply test one resource type and verify that the expected fields are returned.
…idator

Also updates the registry documentation with the appropriate attribute names and adds examples using both optional arguments.

```console
% make testacc PKG=shield TESTS=TestAccShieldProtectionDataSource_basic
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/shield/... -v -count 1 -parallel 20 -run='TestAccShieldProtectionDataSource_basic'  -timeout 360m

--- PASS: TestAccShieldProtectionDataSource_basic (85.86s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/shield     91.931s
```
@jar-b jar-b requested a review from a team as a code owner August 29, 2024 17:23
Copy link
Member

@jar-b jar-b 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 PKG=shield TESTS=TestAccShieldProtectionDataSource_basic
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/shield/... -v -count 1 -parallel 20 -run='TestAccShieldProtectionDataSource_basic'  -timeout 360m

--- PASS: TestAccShieldProtectionDataSource_basic (85.86s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/shield     91.931s

@jar-b
Copy link
Member

jar-b commented Aug 29, 2024

Thanks for your contribution, @hong-yi! 👍

@jar-b jar-b merged commit 15ffdf3 into hashicorp:main Aug 29, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.65.0 milestone Aug 29, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 29, 2024
Copy link

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

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 Sep 29, 2024
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. generators Relates to code generators. new-data-source Introduces a new data source. service/shield Issues and PRs that pertain to the shield 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
Development

Successfully merging this pull request may close these issues.

[New Data Source]: aws_shield_protection data source
3 participants