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

aws_s3_account_public_access_block: Migrate to AWS SDK for Go v2 #34525

Merged
merged 11 commits into from
Nov 22, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Nov 22, 2023

Description

Migrates the aws_s3_account_public_access_block resource and data source to AWS SDK for Go v2.

Relations

Relates #33654.
Relates #32976.
Relates aws/aws-sdk-go-v2#2384.
Relates aws/aws-sdk-go-v2#2385.
Closes #34529.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccS3ControlAccountPublicAccessBlock_serial' PKG=s3control
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3control/... -v -count 1 -parallel 20  -run=TestAccS3ControlAccountPublicAccessBlock_serial -timeout 360m
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial
=== PAUSE TestAccS3ControlAccountPublicAccessBlock_serial
=== CONT  TestAccS3ControlAccountPublicAccessBlock_serial
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/disappears
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/AccountId
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/BlockPublicAcls
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/BlockPublicPolicy
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/IgnorePublicAcls
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/RestrictPublicBuckets
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/DataSourceBasic
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic
--- PASS: TestAccS3ControlAccountPublicAccessBlock_serial (392.78s)
    --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock (392.78s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/disappears (22.78s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/AccountId (29.44s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/BlockPublicAcls (71.28s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/BlockPublicPolicy (74.39s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/IgnorePublicAcls (71.65s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/RestrictPublicBuckets (70.72s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/DataSourceBasic (23.77s)
        --- PASS: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic (28.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3control	398.022s
% make testacc TESTARGS='-run=TestAccS3ControlMultiRegionAccessPoint_' PKG=s3control ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3control/... -v -count 1 -parallel 2  -run=TestAccS3ControlMultiRegionAccessPoint_ -timeout 360m
=== RUN   TestAccS3ControlMultiRegionAccessPoint_basic
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_basic
=== RUN   TestAccS3ControlMultiRegionAccessPoint_disappears
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_disappears
=== RUN   TestAccS3ControlMultiRegionAccessPoint_PublicAccessBlock
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_PublicAccessBlock
=== RUN   TestAccS3ControlMultiRegionAccessPoint_name
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_name
=== RUN   TestAccS3ControlMultiRegionAccessPoint_threeRegions
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_threeRegions
=== RUN   TestAccS3ControlMultiRegionAccessPoint_putAndGetObject
=== PAUSE TestAccS3ControlMultiRegionAccessPoint_putAndGetObject
=== CONT  TestAccS3ControlMultiRegionAccessPoint_basic
=== CONT  TestAccS3ControlMultiRegionAccessPoint_name
--- PASS: TestAccS3ControlMultiRegionAccessPoint_basic (413.44s)
=== CONT  TestAccS3ControlMultiRegionAccessPoint_PublicAccessBlock
--- PASS: TestAccS3ControlMultiRegionAccessPoint_name (630.43s)
=== CONT  TestAccS3ControlMultiRegionAccessPoint_disappears
--- PASS: TestAccS3ControlMultiRegionAccessPoint_PublicAccessBlock (246.34s)
=== CONT  TestAccS3ControlMultiRegionAccessPoint_putAndGetObject
--- PASS: TestAccS3ControlMultiRegionAccessPoint_disappears (242.65s)
=== CONT  TestAccS3ControlMultiRegionAccessPoint_threeRegions
--- PASS: TestAccS3ControlMultiRegionAccessPoint_putAndGetObject (247.40s)
--- PASS: TestAccS3ControlMultiRegionAccessPoint_threeRegions (517.77s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3control	1396.118s

% make testacc TESTARGS='-run=TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic' PKG=s3control
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3control/... -v -count 1 -parallel 20  -run=TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic -timeout 360m
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial
=== PAUSE TestAccS3ControlAccountPublicAccessBlock_serial
=== CONT  TestAccS3ControlAccountPublicAccessBlock_serial
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock
=== RUN   TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic
    account_public_access_block_test.go:48: Step 1/2 error: Error running apply: exit status 1

        Error: creating S3 Account Public Access Block (346386234494): operation error S3 Control: PutPublicAccessBlock, https response error StatusCode: 400, RequestID: 498MQ67VBD7NDMA7, HostID: tgd9dSvggMaadW7W7WpA8D59bDkXXFn3Z+/oTjP03v69xSFxhv5ODC8rsrktdXqEelq+y/4tBM0=, api error InvalidRequest: Must specify at least one configuration.

          with aws_s3_account_public_access_block.test,
          on terraform_plugin_test.tf line 1, in resource "aws_s3_account_public_access_block" "test":
           1: resource "aws_s3_account_public_access_block" "test" {}

--- FAIL: TestAccS3ControlAccountPublicAccessBlock_serial (8.57s)
    --- FAIL: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock (8.57s)
        --- FAIL: TestAccS3ControlAccountPublicAccessBlock_serial/PublicAccessBlock/basic (8.57s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/s3control	14.061s
FAIL
make: *** [testacc] Error 1
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/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3control Issues and PRs that pertain to the s3control service. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. labels Nov 22, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 22, 2023
@ewbankkit ewbankkit added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Nov 22, 2023
dependabot bot and others added 2 commits November 22, 2023 15:43
Bumps the aws-sdk-go group with 2 updates: [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) and [github.com/aws/aws-sdk-go-v2/service/s3control](https://github.com/aws/aws-sdk-go-v2).

Updates `github.com/aws/aws-sdk-go` from 1.48.2 to 1.48.3
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](aws/aws-sdk-go@v1.48.2...v1.48.3)

Updates `github.com/aws/aws-sdk-go-v2/service/s3control` from 1.37.1 to 1.38.0
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.38.0/CHANGELOG.md)
- [Commits](aws/aws-sdk-go-v2@service/s3/v1.37.1...service/s3/v1.38.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws-sdk-go
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3control
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws-sdk-go
...

Signed-off-by: dependabot[bot] <support@github.com>
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.

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Nov 22, 2023
@ewbankkit ewbankkit changed the title [WIP] aws_s3_account_public_access_block: Migrate to AWS SDK for Go v2 aws_s3_account_public_access_block: Migrate to AWS SDK for Go v2 Nov 22, 2023
@ewbankkit ewbankkit merged commit 506f81f into main Nov 22, 2023
71 checks passed
@ewbankkit ewbankkit deleted the td-s3control-all-aws-sdk-go-v2 branch November 22, 2023 21:28
@github-actions github-actions bot added this to the v5.27.0 milestone Nov 22, 2023
Copy link

This functionality has been released in v5.27.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 Dec 28, 2023
@justinretzolk justinretzolk added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/s3control Issues and PRs that pertain to the s3control service. size/L Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

2 participants