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

Allow aws_s3_bucket_object to be imported #10036

Merged
merged 6 commits into from
Jul 28, 2021

Conversation

dhdersch
Copy link

@dhdersch dhdersch commented Sep 6, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #9903

Release note for CHANGELOG:

resource/aws_s3_bucket_object: Can now be imported.

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3BucketObject_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3BucketObject_ -timeout 120m
=== RUN   TestAccAWSS3BucketObject_noNameNoKey
=== PAUSE TestAccAWSS3BucketObject_noNameNoKey
=== RUN   TestAccAWSS3BucketObject_empty
=== PAUSE TestAccAWSS3BucketObject_empty
=== RUN   TestAccAWSS3BucketObject_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_etagEncryption
=== PAUSE TestAccAWSS3BucketObject_etagEncryption
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== RUN   TestAccAWSS3BucketObject_updateSameFile
=== PAUSE TestAccAWSS3BucketObject_updateSameFile
=== RUN   TestAccAWSS3BucketObject_updatesWithVersioning
=== PAUSE TestAccAWSS3BucketObject_updatesWithVersioning
=== RUN   TestAccAWSS3BucketObject_kms
=== PAUSE TestAccAWSS3BucketObject_kms
=== RUN   TestAccAWSS3BucketObject_sse
=== PAUSE TestAccAWSS3BucketObject_sse
=== RUN   TestAccAWSS3BucketObject_acl
=== PAUSE TestAccAWSS3BucketObject_acl
=== RUN   TestAccAWSS3BucketObject_metadata
=== PAUSE TestAccAWSS3BucketObject_metadata
=== RUN   TestAccAWSS3BucketObject_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_noNameNoKey
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_content
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_empty
=== CONT  TestAccAWSS3BucketObject_updateSameFile
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_etagEncryption
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_metadata
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_tags
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (7.67s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (38.55s)
--- PASS: TestAccAWSS3BucketObject_content (38.55s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (38.57s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (38.84s)
--- PASS: TestAccAWSS3BucketObject_empty (39.51s)
--- PASS: TestAccAWSS3BucketObject_source (39.79s)
--- PASS: TestAccAWSS3BucketObject_sse (40.53s)
--- PASS: TestAccAWSS3BucketObject_updates (63.35s)
--- PASS: TestAccAWSS3BucketObject_kms (63.53s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (63.72s)
--- PASS: TestAccAWSS3BucketObject_metadata (79.54s)
--- PASS: TestAccAWSS3BucketObject_acl (83.62s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (87.43s)
--- PASS: TestAccAWSS3BucketObject_tags (101.01s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (101.38s)
--- PASS: TestAccAWSS3BucketObject_storageClass (130.48s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	130.545s

@dhdersch dhdersch requested a review from a team September 6, 2019 22:41
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/s3 Issues and PRs that pertain to the s3 service. labels Sep 6, 2019
@ghost ghost added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L 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 Sep 6, 2019
@nywilken nywilken added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 2, 2019
@salemgolemugoo
Copy link

Please merge this one

@obeleh
Copy link

obeleh commented Jul 24, 2020

Can someone explain what the reason is for this PR not being merged?

@noaginzbursky
Copy link

Is there any update here?

@nickpalmer
Copy link

This is much needed! Can we please get this merged?

@danquack
Copy link
Contributor

danquack commented Dec 7, 2020

@breathingdust can this be looked at? Been sitting over a year, and has a bunch of likes. Not 300+ like some PRs in the roadmap, but its also been a while so people probably dont see it

Base automatically changed from master to main January 23, 2021 00:56
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:56
@nmelnick
Copy link

I'm not sure what the status of this is going forward, and I'm not a member of the terraform project. I just gave this a shot in a local repository, and noted that S3 object errors would not be reported properly to the user, instead just sending nil back. Terraform will then report:

Error: nil entry in ImportState results. This is always a bug with
the resource that is being imported. Please report this as
a bug to Terraform.

Otherwise, this worked a treat. Thanks for your work on this!

@bill-rich bill-rich force-pushed the import-for-aws_s3_bucket_object branch from dde1169 to 7c36be7 Compare July 27, 2021 23:05
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Jul 27, 2021
Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

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

LGTM

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSS3BucketObject -timeout 180m
=== RUN   TestAccAWSS3BucketObject_noNameNoKey
=== PAUSE TestAccAWSS3BucketObject_noNameNoKey
=== RUN   TestAccAWSS3BucketObject_empty
=== PAUSE TestAccAWSS3BucketObject_empty
=== RUN   TestAccAWSS3BucketObject_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_etagEncryption
=== PAUSE TestAccAWSS3BucketObject_etagEncryption
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_sourceHashTrigger
=== PAUSE TestAccAWSS3BucketObject_sourceHashTrigger
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_nonVersioned
=== PAUSE TestAccAWSS3BucketObject_nonVersioned
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== RUN   TestAccAWSS3BucketObject_updateSameFile
=== PAUSE TestAccAWSS3BucketObject_updateSameFile
=== RUN   TestAccAWSS3BucketObject_updatesWithVersioning
=== PAUSE TestAccAWSS3BucketObject_updatesWithVersioning
=== RUN   TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint
=== PAUSE TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint
=== RUN   TestAccAWSS3BucketObject_kms
=== PAUSE TestAccAWSS3BucketObject_kms
=== RUN   TestAccAWSS3BucketObject_sse
=== PAUSE TestAccAWSS3BucketObject_sse
=== RUN   TestAccAWSS3BucketObject_acl
=== PAUSE TestAccAWSS3BucketObject_acl
=== RUN   TestAccAWSS3BucketObject_metadata
=== PAUSE TestAccAWSS3BucketObject_metadata
=== RUN   TestAccAWSS3BucketObject_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSingleSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSingleSlash
=== RUN   TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes
=== RUN   TestAccAWSS3BucketObject_tagsMultipleSlashes
=== PAUSE TestAccAWSS3BucketObject_tagsMultipleSlashes
=== RUN   TestAccAWSS3BucketObject_objectLockLegalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_objectLockLegalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_objectLockLegalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_objectLockLegalHoldStartWithOn
=== RUN   TestAccAWSS3BucketObject_objectLockRetentionStartWithNone
=== PAUSE TestAccAWSS3BucketObject_objectLockRetentionStartWithNone
=== RUN   TestAccAWSS3BucketObject_objectLockRetentionStartWithSet
=== PAUSE TestAccAWSS3BucketObject_objectLockRetentionStartWithSet
=== RUN   TestAccAWSS3BucketObject_objectBucketKeyEnabled
=== PAUSE TestAccAWSS3BucketObject_objectBucketKeyEnabled
=== RUN   TestAccAWSS3BucketObject_bucketBucketKeyEnabled
=== PAUSE TestAccAWSS3BucketObject_bucketBucketKeyEnabled
=== RUN   TestAccAWSS3BucketObject_defaultBucketSSE
=== PAUSE TestAccAWSS3BucketObject_defaultBucketSSE
=== RUN   TestAccAWSS3BucketObject_ignoreTags
=== PAUSE TestAccAWSS3BucketObject_ignoreTags
=== CONT  TestAccAWSS3BucketObject_noNameNoKey
=== CONT  TestAccAWSS3BucketObject_metadata
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_updateSameFile
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_etagEncryption
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_sourceHashTrigger
=== CONT  TestAccAWSS3BucketObject_nonVersioned
=== CONT  TestAccAWSS3BucketObject_content
=== CONT  TestAccAWSS3BucketObject_empty
=== CONT  TestAccAWSS3BucketObject_objectLockLegalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_objectLockRetentionStartWithNone
=== CONT  TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes
=== CONT  TestAccAWSS3BucketObject_nonVersioned
    provider_test.go:2223: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAWSS3BucketObject_nonVersioned (1.08s)
=== CONT  TestAccAWSS3BucketObject_storageClass
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (3.70s)
=== CONT  TestAccAWSS3BucketObject_defaultBucketSSE
--- PASS: TestAccAWSS3BucketObject_contentBase64 (29.07s)
=== CONT  TestAccAWSS3BucketObject_tagsMultipleSlashes
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (30.40s)
=== CONT  TestAccAWSS3BucketObject_objectLockLegalHoldStartWithNone
--- PASS: TestAccAWSS3BucketObject_kms (31.73s)
=== CONT  TestAccAWSS3BucketObject_bucketBucketKeyEnabled
--- PASS: TestAccAWSS3BucketObject_etagEncryption (31.99s)
=== CONT  TestAccAWSS3BucketObject_objectBucketKeyEnabled
--- PASS: TestAccAWSS3BucketObject_source (32.28s)
=== CONT  TestAccAWSS3BucketObject_objectLockRetentionStartWithSet
--- PASS: TestAccAWSS3BucketObject_defaultBucketSSE (28.72s)
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSingleSlash
--- PASS: TestAccAWSS3BucketObject_content (32.72s)
=== CONT  TestAccAWSS3BucketObject_ignoreTags
--- PASS: TestAccAWSS3BucketObject_empty (33.23s)
=== CONT  TestAccAWSS3BucketObject_tags
--- PASS: TestAccAWSS3BucketObject_sse (33.29s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (49.11s)
--- PASS: TestAccAWSS3BucketObject_objectLockLegalHoldStartWithOn (49.44s)
--- PASS: TestAccAWSS3BucketObject_sourceHashTrigger (49.95s)
--- PASS: TestAccAWSS3BucketObject_updates (51.04s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint (51.21s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (51.66s)
--- PASS: TestAccAWSS3BucketObject_objectBucketKeyEnabled (21.61s)
--- PASS: TestAccAWSS3BucketObject_bucketBucketKeyEnabled (23.63s)
--- PASS: TestAccAWSS3BucketObject_objectLockRetentionStartWithNone (65.95s)
--- PASS: TestAccAWSS3BucketObject_metadata (65.96s)
--- PASS: TestAccAWSS3BucketObject_acl (67.95s)
--- PASS: TestAccAWSS3BucketObject_ignoreTags (39.09s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes (82.23s)
--- PASS: TestAccAWSS3BucketObject_objectLockLegalHoldStartWithNone (53.58s)
--- PASS: TestAccAWSS3BucketObject_storageClass (97.75s)
--- PASS: TestAccAWSS3BucketObject_tagsMultipleSlashes (71.82s)
--- PASS: TestAccAWSS3BucketObject_objectLockRetentionStartWithSet (72.64s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSingleSlash (73.95s)
--- PASS: TestAccAWSS3BucketObject_tags (76.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	109.421s

@bill-rich bill-rich merged commit 521730e into hashicorp:main Jul 28, 2021
@github-actions github-actions bot added this to the v3.52.0 milestone Jul 28, 2021
ewbankkit added a commit that referenced this pull request Jul 28, 2021
@dhdersch
Copy link
Author

Incredible to see this merged after all this time! Thanks! I don't even hardly remember writing this.

ewbankkit added a commit that referenced this pull request Jul 28, 2021
@github-actions
Copy link

This functionality has been released in v3.52.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 Aug 29, 2021
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. enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. size/M 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.

Add support for importing resource aws_s3_bucket_object
9 participants