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

s3 datasource aws_s3_object can read application/xml #27704

Merged

Conversation

Ken-Sumi1019
Copy link
Contributor

@Ken-Sumi1019 Ken-Sumi1019 commented Nov 8, 2022

Description

This fix allows datasource aws_s3_object to read application/xml.

Relations

Closes #27697

References

Output from Acceptance Testing

$ make testacc TESTS=TestAccS3ObjectDataSource PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3ObjectDataSource'  -timeout 180m
=== RUN   TestAccS3ObjectDataSource_basic
=== PAUSE TestAccS3ObjectDataSource_basic
=== RUN   TestAccS3ObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3ObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3ObjectDataSource_readableBody
=== PAUSE TestAccS3ObjectDataSource_readableBody
=== RUN   TestAccS3ObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3ObjectDataSource_kmsEncrypted
=== RUN   TestAccS3ObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3ObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3ObjectDataSource_allParams
=== PAUSE TestAccS3ObjectDataSource_allParams
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3ObjectDataSource_leadingSlash
=== PAUSE TestAccS3ObjectDataSource_leadingSlash
=== RUN   TestAccS3ObjectDataSource_multipleSlashes
=== PAUSE TestAccS3ObjectDataSource_multipleSlashes
=== RUN   TestAccS3ObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_basic
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== CONT  TestAccS3ObjectDataSource_kmsEncrypted
=== CONT  TestAccS3ObjectDataSource_bucketKeyEnabled
=== CONT  TestAccS3ObjectDataSource_readableBody
=== CONT  TestAccS3ObjectDataSource_multipleSlashes
=== CONT  TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_leadingSlash
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== CONT  TestAccS3ObjectDataSource_allParams
=== CONT  TestAccS3ObjectDataSource_basicViaAccessPoint
--- PASS: TestAccS3ObjectDataSource_singleSlashAsKey (47.73s)
--- PASS: TestAccS3ObjectDataSource_readableBody (49.47s)
--- PASS: TestAccS3ObjectDataSource_basic (49.62s)
--- PASS: TestAccS3ObjectDataSource_bucketKeyEnabled (50.22s)
--- PASS: TestAccS3ObjectDataSource_kmsEncrypted (51.79s)
--- PASS: TestAccS3ObjectDataSource_basicViaAccessPoint (52.13s)
--- PASS: TestAccS3ObjectDataSource_allParams (54.36s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOn (54.50s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOff (54.61s)
--- PASS: TestAccS3ObjectDataSource_multipleSlashes (77.38s)
--- PASS: TestAccS3ObjectDataSource_leadingSlash (78.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/s3 78.097s

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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/XS Managed by automation to categorize the size of a PR. service/s3 Issues and PRs that pertain to the s3 service. needs-triage Waiting for first response or review from a maintainer. labels Nov 8, 2022
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 @Ken-Sumi1019 👋

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

@Ken-Sumi1019 Ken-Sumi1019 marked this pull request as ready for review November 8, 2022 20:48
@Ken-Sumi1019 Ken-Sumi1019 marked this pull request as draft November 8, 2022 20:49
@Ken-Sumi1019 Ken-Sumi1019 force-pushed the s3-object-can-read-application-xml branch from d7c62e9 to bb03b7f Compare November 8, 2022 20:50
@Ken-Sumi1019 Ken-Sumi1019 marked this pull request as ready for review November 8, 2022 20:51
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 8, 2022
@Ken-Sumi1019 Ken-Sumi1019 marked this pull request as draft November 11, 2022 23:58
@Ken-Sumi1019 Ken-Sumi1019 marked this pull request as ready for review November 11, 2022 23:58
@Ken-Sumi1019
Copy link
Contributor Author

I have noted the acceptance test results.

@YakDriver YakDriver self-assigned this Feb 10, 2023
@YakDriver YakDriver force-pushed the s3-object-can-read-application-xml branch from bb03b7f to 1fa3b44 Compare February 10, 2023 23:10
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.

LGTM 🎉

% make t T=TestAccS3ObjectDataSource K=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3ObjectDataSource'  -timeout 180m
=== RUN   TestAccS3ObjectDataSource_basic
=== PAUSE TestAccS3ObjectDataSource_basic
=== RUN   TestAccS3ObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3ObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3ObjectDataSource_readableBody
=== PAUSE TestAccS3ObjectDataSource_readableBody
=== RUN   TestAccS3ObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3ObjectDataSource_kmsEncrypted
=== RUN   TestAccS3ObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3ObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3ObjectDataSource_allParams
=== PAUSE TestAccS3ObjectDataSource_allParams
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3ObjectDataSource_leadingSlash
=== PAUSE TestAccS3ObjectDataSource_leadingSlash
=== RUN   TestAccS3ObjectDataSource_multipleSlashes
=== PAUSE TestAccS3ObjectDataSource_multipleSlashes
=== RUN   TestAccS3ObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_basic
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== CONT  TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_leadingSlash
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== CONT  TestAccS3ObjectDataSource_kmsEncrypted
=== CONT  TestAccS3ObjectDataSource_readableBody
=== CONT  TestAccS3ObjectDataSource_multipleSlashes
=== CONT  TestAccS3ObjectDataSource_allParams
=== CONT  TestAccS3ObjectDataSource_basicViaAccessPoint
=== CONT  TestAccS3ObjectDataSource_bucketKeyEnabled
--- PASS: TestAccS3ObjectDataSource_singleSlashAsKey (26.71s)
--- PASS: TestAccS3ObjectDataSource_readableBody (28.97s)
--- PASS: TestAccS3ObjectDataSource_basic (29.00s)
--- PASS: TestAccS3ObjectDataSource_bucketKeyEnabled (29.27s)
--- PASS: TestAccS3ObjectDataSource_basicViaAccessPoint (30.16s)
--- PASS: TestAccS3ObjectDataSource_kmsEncrypted (30.41s)
--- PASS: TestAccS3ObjectDataSource_allParams (32.44s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOff (32.62s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOn (33.44s)
--- PASS: TestAccS3ObjectDataSource_leadingSlash (43.38s)
--- PASS: TestAccS3ObjectDataSource_multipleSlashes (44.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	46.331s
% make t T=TestAccS3BucketObjectDataSource K=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3BucketObjectDataSource'  -timeout 180m
=== RUN   TestAccS3BucketObjectDataSource_basic
=== PAUSE TestAccS3BucketObjectDataSource_basic
=== RUN   TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3BucketObjectDataSource_readableBody
=== PAUSE TestAccS3BucketObjectDataSource_readableBody
=== RUN   TestAccS3BucketObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3BucketObjectDataSource_kmsEncrypted
=== RUN   TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3BucketObjectDataSource_allParams
=== PAUSE TestAccS3BucketObjectDataSource_allParams
=== RUN   TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3BucketObjectDataSource_leadingSlash
=== PAUSE TestAccS3BucketObjectDataSource_leadingSlash
=== RUN   TestAccS3BucketObjectDataSource_multipleSlashes
=== PAUSE TestAccS3BucketObjectDataSource_multipleSlashes
=== RUN   TestAccS3BucketObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3BucketObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3BucketObjectDataSource_basic
=== CONT  TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== CONT  TestAccS3BucketObjectDataSource_kmsEncrypted
=== CONT  TestAccS3BucketObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== CONT  TestAccS3BucketObjectDataSource_multipleSlashes
=== CONT  TestAccS3BucketObjectDataSource_allParams
=== CONT  TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== CONT  TestAccS3BucketObjectDataSource_readableBody
=== CONT  TestAccS3BucketObjectDataSource_leadingSlash
=== CONT  TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
--- PASS: TestAccS3BucketObjectDataSource_singleSlashAsKey (27.35s)
--- PASS: TestAccS3BucketObjectDataSource_readableBody (27.96s)
--- PASS: TestAccS3BucketObjectDataSource_basic (29.38s)
--- PASS: TestAccS3BucketObjectDataSource_bucketKeyEnabled (29.53s)
--- PASS: TestAccS3BucketObjectDataSource_kmsEncrypted (30.58s)
--- PASS: TestAccS3BucketObjectDataSource_basicViaAccessPoint (30.65s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOff (32.26s)
--- PASS: TestAccS3BucketObjectDataSource_allParams (32.82s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOn (32.89s)
--- PASS: TestAccS3BucketObjectDataSource_leadingSlash (43.65s)
--- PASS: TestAccS3BucketObjectDataSource_multipleSlashes (44.49s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	46.391s

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.

LGTM 🎉

% make t T=TestAccS3ObjectDataSource K=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3ObjectDataSource'  -timeout 180m
=== RUN   TestAccS3ObjectDataSource_basic
=== PAUSE TestAccS3ObjectDataSource_basic
=== RUN   TestAccS3ObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3ObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3ObjectDataSource_readableBody
=== PAUSE TestAccS3ObjectDataSource_readableBody
=== RUN   TestAccS3ObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3ObjectDataSource_kmsEncrypted
=== RUN   TestAccS3ObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3ObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3ObjectDataSource_allParams
=== PAUSE TestAccS3ObjectDataSource_allParams
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3ObjectDataSource_leadingSlash
=== PAUSE TestAccS3ObjectDataSource_leadingSlash
=== RUN   TestAccS3ObjectDataSource_multipleSlashes
=== PAUSE TestAccS3ObjectDataSource_multipleSlashes
=== RUN   TestAccS3ObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_basic
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== CONT  TestAccS3ObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3ObjectDataSource_leadingSlash
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== CONT  TestAccS3ObjectDataSource_kmsEncrypted
=== CONT  TestAccS3ObjectDataSource_readableBody
=== CONT  TestAccS3ObjectDataSource_multipleSlashes
=== CONT  TestAccS3ObjectDataSource_allParams
=== CONT  TestAccS3ObjectDataSource_basicViaAccessPoint
=== CONT  TestAccS3ObjectDataSource_bucketKeyEnabled
--- PASS: TestAccS3ObjectDataSource_singleSlashAsKey (26.71s)
--- PASS: TestAccS3ObjectDataSource_readableBody (28.97s)
--- PASS: TestAccS3ObjectDataSource_basic (29.00s)
--- PASS: TestAccS3ObjectDataSource_bucketKeyEnabled (29.27s)
--- PASS: TestAccS3ObjectDataSource_basicViaAccessPoint (30.16s)
--- PASS: TestAccS3ObjectDataSource_kmsEncrypted (30.41s)
--- PASS: TestAccS3ObjectDataSource_allParams (32.44s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOff (32.62s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOn (33.44s)
--- PASS: TestAccS3ObjectDataSource_leadingSlash (43.38s)
--- PASS: TestAccS3ObjectDataSource_multipleSlashes (44.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	46.331s
% make t T=TestAccS3BucketObjectDataSource K=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3BucketObjectDataSource'  -timeout 180m
=== RUN   TestAccS3BucketObjectDataSource_basic
=== PAUSE TestAccS3BucketObjectDataSource_basic
=== RUN   TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3BucketObjectDataSource_readableBody
=== PAUSE TestAccS3BucketObjectDataSource_readableBody
=== RUN   TestAccS3BucketObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3BucketObjectDataSource_kmsEncrypted
=== RUN   TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3BucketObjectDataSource_allParams
=== PAUSE TestAccS3BucketObjectDataSource_allParams
=== RUN   TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3BucketObjectDataSource_leadingSlash
=== PAUSE TestAccS3BucketObjectDataSource_leadingSlash
=== RUN   TestAccS3BucketObjectDataSource_multipleSlashes
=== PAUSE TestAccS3BucketObjectDataSource_multipleSlashes
=== RUN   TestAccS3BucketObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3BucketObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3BucketObjectDataSource_basic
=== CONT  TestAccS3BucketObjectDataSource_objectLockLegalHoldOff
=== CONT  TestAccS3BucketObjectDataSource_kmsEncrypted
=== CONT  TestAccS3BucketObjectDataSource_singleSlashAsKey
=== CONT  TestAccS3BucketObjectDataSource_basicViaAccessPoint
=== CONT  TestAccS3BucketObjectDataSource_multipleSlashes
=== CONT  TestAccS3BucketObjectDataSource_allParams
=== CONT  TestAccS3BucketObjectDataSource_bucketKeyEnabled
=== CONT  TestAccS3BucketObjectDataSource_readableBody
=== CONT  TestAccS3BucketObjectDataSource_leadingSlash
=== CONT  TestAccS3BucketObjectDataSource_objectLockLegalHoldOn
--- PASS: TestAccS3BucketObjectDataSource_singleSlashAsKey (27.35s)
--- PASS: TestAccS3BucketObjectDataSource_readableBody (27.96s)
--- PASS: TestAccS3BucketObjectDataSource_basic (29.38s)
--- PASS: TestAccS3BucketObjectDataSource_bucketKeyEnabled (29.53s)
--- PASS: TestAccS3BucketObjectDataSource_kmsEncrypted (30.58s)
--- PASS: TestAccS3BucketObjectDataSource_basicViaAccessPoint (30.65s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOff (32.26s)
--- PASS: TestAccS3BucketObjectDataSource_allParams (32.82s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOn (32.89s)
--- PASS: TestAccS3BucketObjectDataSource_leadingSlash (43.65s)
--- PASS: TestAccS3BucketObjectDataSource_multipleSlashes (44.49s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	46.391s

@YakDriver YakDriver merged commit 3c8bd5a into hashicorp:main Feb 10, 2023
@github-actions github-actions bot added this to the v4.55.0 milestone Feb 10, 2023
@github-actions
Copy link

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

@Ken-Sumi1019 Ken-Sumi1019 deleted the s3-object-can-read-application-xml branch February 18, 2023 12:39
@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 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: datasource aws_s3_object refuses to import data from legitimate "human readable" content-types
3 participants