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 support for S3 Object Lock legal holds #7179

Closed
wants to merge 6 commits into from

Conversation

ewbankkit
Copy link
Contributor

Fixes #7158.

Acceptance tests:

$ 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_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== 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_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithNone
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_content
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_tags
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (54.90s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (55.74s)
--- PASS: TestAccAWSS3BucketObject_content (57.67s)
--- PASS: TestAccAWSS3BucketObject_sse (58.27s)
--- PASS: TestAccAWSS3BucketObject_source (59.09s)
--- PASS: TestAccAWSS3BucketObject_updates (85.93s)
--- PASS: TestAccAWSS3BucketObject_kms (86.52s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (87.73s)
--- PASS: TestAccAWSS3BucketObject_acl (113.61s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithOn (115.63s)
--- PASS: TestAccAWSS3BucketObject_tags (127.97s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithNone (129.84s)
--- PASS: TestAccAWSS3BucketObject_storageClass (136.03s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	137.319s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAWSS3BucketObject_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAWSS3BucketObject_ -timeout 120m
=== RUN   TestAccDataSourceAWSS3BucketObject_basic
=== PAUSE TestAccDataSourceAWSS3BucketObject_basic
=== RUN   TestAccDataSourceAWSS3BucketObject_readableBody
=== PAUSE TestAccDataSourceAWSS3BucketObject_readableBody
=== RUN   TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== PAUSE TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== RUN   TestAccDataSourceAWSS3BucketObject_allParams
=== PAUSE TestAccDataSourceAWSS3BucketObject_allParams
=== CONT  TestAccDataSourceAWSS3BucketObject_basic
=== CONT  TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== CONT  TestAccDataSourceAWSS3BucketObject_readableBody
=== CONT  TestAccDataSourceAWSS3BucketObject_allParams
--- PASS: TestAccDataSourceAWSS3BucketObject_basic (49.58s)
--- PASS: TestAccDataSourceAWSS3BucketObject_readableBody (50.28s)
--- PASS: TestAccDataSourceAWSS3BucketObject_allParams (52.94s)
--- PASS: TestAccDataSourceAWSS3BucketObject_kmsEncrypted (75.85s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	91.353s

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/s3 Issues and PRs that pertain to the s3 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 17, 2019
},
}
}

func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).s3conn

restricted := meta.(*AWSClient).IsChinaCloud()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duplicate logic from aws_s3_bucket_object resource.

@@ -102,3 +102,14 @@ func suppressAutoscalingGroupAvailabilityZoneDiffs(k, old, new string, d *schema
func suppressRoute53ZoneNameWithTrailingDot(k, old, new string, d *schema.ResourceData) bool {
return strings.TrimSuffix(old, ".") == strings.TrimSuffix(new, ".")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inspired by #5508 (comment).
I'll create an issue to refactor other uses.


if _, ok := d.GetOk("version_id"); ok {
Copy link
Contributor Author

@ewbankkit ewbankkit Jan 17, 2019

Choose a reason for hiding this comment

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

Collapse the versioned and non-versioned branches. VersionId is nil for non-versioned buckets.

}

for _, v := range respList.Versions {
if aws.StringValue(v.Key) != key {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ensure we don't delete too many objects 😄.

@ewbankkit
Copy link
Contributor Author

Rebased to remove conflicts.
Acceptance tests:

$ 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_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== 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_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSlash
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithNone
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_tags
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_source (30.93s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (30.94s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (31.09s)
--- PASS: TestAccAWSS3BucketObject_sse (31.23s)
--- PASS: TestAccAWSS3BucketObject_content (31.25s)
--- PASS: TestAccAWSS3BucketObject_updates (51.29s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (52.48s)
--- PASS: TestAccAWSS3BucketObject_kms (54.66s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithOn (71.43s)
--- PASS: TestAccAWSS3BucketObject_acl (74.87s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithNone (89.71s)
--- PASS: TestAccAWSS3BucketObject_storageClass (92.93s)
--- PASS: TestAccAWSS3BucketObject_tags (93.26s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (93.27s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	93.292s

@ewbankkit
Copy link
Contributor Author

Reuse code added in #7398 to delete all S3 object versions.
Acceptance tests:

$ 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_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== 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_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSlash
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithNone
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_tags
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_content (31.40s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (31.67s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (32.41s)
--- PASS: TestAccAWSS3BucketObject_sse (32.49s)
--- PASS: TestAccAWSS3BucketObject_source (32.51s)
--- PASS: TestAccAWSS3BucketObject_updates (52.65s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (52.74s)
--- PASS: TestAccAWSS3BucketObject_kms (54.46s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithOn (73.61s)
--- PASS: TestAccAWSS3BucketObject_acl (75.41s)
--- PASS: TestAccAWSS3BucketObject_storageClass (91.74s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithNone (91.95s)
--- PASS: TestAccAWSS3BucketObject_tags (92.17s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (93.63s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	93.648s
$ go test ./aws -v -sweep=us-west-2 -sweep-run=aws_s3_bucket_object -timeout 10h
2019/02/01 11:35:16 [DEBUG] Running Sweepers for region (us-west-2):
2019/02/01 11:35:16 [INFO] Building AWS region structure
2019/02/01 11:35:16 [INFO] Building AWS auth structure
2019/02/01 11:35:16 [INFO] Setting AWS metadata API timeout to 100ms
2019/02/01 11:35:17 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2019/02/01 11:35:17 [INFO] AWS Auth provider used: "EnvProvider"
2019/02/01 11:35:17 [INFO] Initializing DeviceFarm SDK connection
2019/02/01 11:35:17 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2019/02/01 11:35:18 [INFO] Skipping S3 Bucket: 000000000000-awsmacietrail-dataevent
2019/02/01 11:35:18 Sweeper Tests ran:
	- aws_s3_bucket_object
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1.985s

@ewbankkit ewbankkit changed the title Add support for S3 Object Lock legal holds [WIP] Add support for S3 Object Lock legal holds Feb 4, 2019
@ewbankkit
Copy link
Contributor Author

Back to WIP.
I want to reuse the various object deletion functions with the aws_s3_bucket.force_destroy logic: https://github.com/terraform-providers/terraform-provider-aws/blob/a2091a57357303ad1eb03a40a7d19e30e4fee5b1/aws/resource_aws_s3_bucket.go#L1247-L1298

@ewbankkit ewbankkit changed the title [WIP] Add support for S3 Object Lock legal holds Add support for S3 Object Lock legal holds Feb 8, 2019
@ewbankkit
Copy link
Contributor Author

Removed WIP.

  • Renamed aws_s3_bucket_object.force_delete to aws_s3_bucket_object.force_destroy to match aws_s3_bucket resource attribute of the same name
  • Document that aws_s3_bucket.force_destroy removes any locked objects in the bucket
  • Added aws_s3_bucket acceptance tests for force_destroy

NOW this PR is ready for review.

Acceptance tests:

$ 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_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== 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_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSlash
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithNone
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_tags
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_contentBase64 (31.61s)
--- PASS: TestAccAWSS3BucketObject_content (31.63s)
--- PASS: TestAccAWSS3BucketObject_source (31.95s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (32.22s)
--- PASS: TestAccAWSS3BucketObject_sse (33.16s)
--- PASS: TestAccAWSS3BucketObject_updates (52.44s)
--- PASS: TestAccAWSS3BucketObject_kms (57.60s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithOn (72.42s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (74.68s)
--- PASS: TestAccAWSS3BucketObject_acl (75.30s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (93.16s)
--- PASS: TestAccAWSS3BucketObject_storageClass (93.56s)
--- PASS: TestAccAWSS3BucketObject_tags (93.57s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithNone (95.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	95.144s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_forceDestroy'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3Bucket_forceDestroy -timeout 120m
=== RUN   TestAccAWSS3Bucket_forceDestroy
=== PAUSE TestAccAWSS3Bucket_forceDestroy
=== CONT  TestAccAWSS3Bucket_forceDestroy
--- PASS: TestAccAWSS3Bucket_forceDestroy (30.74s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	30.752s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled -timeout 120m
=== RUN   TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
=== CONT  TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (35.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	35.363s
$ go test ./aws -v -sweep=us-west-2 -sweep-run=aws_s3_bucket_object -timeout 10h
2019/02/08 17:04:28 [DEBUG] Running Sweepers for region (us-west-2):
2019/02/08 17:04:28 [INFO] Building AWS region structure
2019/02/08 17:04:28 [INFO] Building AWS auth structure
2019/02/08 17:04:28 [INFO] Setting AWS metadata API timeout to 100ms
2019/02/08 17:04:29 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2019/02/08 17:04:29 [INFO] AWS Auth provider used: "EnvProvider"
2019/02/08 17:04:29 [INFO] Initializing DeviceFarm SDK connection
2019/02/08 17:04:29 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2019/02/08 17:04:30 [INFO] Skipping S3 Bucket: 346386234494-awsmacietrail-dataevent
2019/02/08 17:04:30 [INFO] Skipping S3 Bucket: ewbankkit-testing-s3-legal-hold-delete
2019/02/08 17:04:32 [INFO] Deleting S3 Bucket (tf-test-bucket-4006671096919982311) Object (data.txt) Version: g40aDCkOjNOGUt_Ckj0YuHaTUkTKpA7W
2019/02/08 17:04:34 [INFO] Deleting S3 Bucket (tf-test-bucket-4006671096919982311) Object (prefix/more_data.txt) Version: 339q3WqYMwbVJ75c_NWZ5xmj6iBjNccb
2019/02/08 17:04:35 Sweeper Tests ran:
	- aws_s3_bucket_object
ok  	github.com/terraform-providers/terraform-provider-aws/aws	6.823s

@ewbankkit
Copy link
Contributor Author

Rebased to remove merge conflicts.
Acceptance test:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAWSS3BucketObject_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAWSS3BucketObject_ -timeout 120m
=== RUN   TestAccDataSourceAWSS3BucketObject_basic
=== PAUSE TestAccDataSourceAWSS3BucketObject_basic
=== RUN   TestAccDataSourceAWSS3BucketObject_readableBody
=== PAUSE TestAccDataSourceAWSS3BucketObject_readableBody
=== RUN   TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== PAUSE TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== RUN   TestAccDataSourceAWSS3BucketObject_allParams
=== PAUSE TestAccDataSourceAWSS3BucketObject_allParams
=== CONT  TestAccDataSourceAWSS3BucketObject_basic
=== CONT  TestAccDataSourceAWSS3BucketObject_allParams
=== CONT  TestAccDataSourceAWSS3BucketObject_kmsEncrypted
=== CONT  TestAccDataSourceAWSS3BucketObject_readableBody
--- PASS: TestAccDataSourceAWSS3BucketObject_readableBody (47.95s)
--- PASS: TestAccDataSourceAWSS3BucketObject_basic (48.79s)
--- PASS: TestAccDataSourceAWSS3BucketObject_allParams (53.27s)
--- PASS: TestAccDataSourceAWSS3BucketObject_kmsEncrypted (72.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	72.019s
$ 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_source
=== PAUSE TestAccAWSS3BucketObject_source
=== RUN   TestAccAWSS3BucketObject_content
=== PAUSE TestAccAWSS3BucketObject_content
=== RUN   TestAccAWSS3BucketObject_contentBase64
=== PAUSE TestAccAWSS3BucketObject_contentBase64
=== RUN   TestAccAWSS3BucketObject_withContentCharacteristics
=== PAUSE TestAccAWSS3BucketObject_withContentCharacteristics
=== RUN   TestAccAWSS3BucketObject_updates
=== PAUSE TestAccAWSS3BucketObject_updates
=== 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_storageClass
=== PAUSE TestAccAWSS3BucketObject_storageClass
=== RUN   TestAccAWSS3BucketObject_tags
=== PAUSE TestAccAWSS3BucketObject_tags
=== RUN   TestAccAWSS3BucketObject_tagsLeadingSlash
=== PAUSE TestAccAWSS3BucketObject_tagsLeadingSlash
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithNone
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithNone
=== RUN   TestAccAWSS3BucketObject_legalHoldStartWithOn
=== PAUSE TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_source
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithOn
=== CONT  TestAccAWSS3BucketObject_legalHoldStartWithNone
=== CONT  TestAccAWSS3BucketObject_tagsLeadingSlash
=== CONT  TestAccAWSS3BucketObject_tags
=== CONT  TestAccAWSS3BucketObject_storageClass
=== CONT  TestAccAWSS3BucketObject_acl
=== CONT  TestAccAWSS3BucketObject_sse
=== CONT  TestAccAWSS3BucketObject_kms
=== CONT  TestAccAWSS3BucketObject_updatesWithVersioning
=== CONT  TestAccAWSS3BucketObject_updates
=== CONT  TestAccAWSS3BucketObject_withContentCharacteristics
=== CONT  TestAccAWSS3BucketObject_contentBase64
=== CONT  TestAccAWSS3BucketObject_content
--- PASS: TestAccAWSS3BucketObject_contentBase64 (31.46s)
--- PASS: TestAccAWSS3BucketObject_content (31.51s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (32.20s)
--- PASS: TestAccAWSS3BucketObject_source (32.34s)
--- PASS: TestAccAWSS3BucketObject_sse (32.88s)
--- PASS: TestAccAWSS3BucketObject_updates (54.05s)
--- PASS: TestAccAWSS3BucketObject_kms (55.14s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithOn (72.67s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (74.62s)
--- PASS: TestAccAWSS3BucketObject_acl (74.92s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (93.93s)
--- PASS: TestAccAWSS3BucketObject_storageClass (94.37s)
--- PASS: TestAccAWSS3BucketObject_legalHoldStartWithNone (94.46s)
--- PASS: TestAccAWSS3BucketObject_tags (94.97s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	94.989s

@aeschright aeschright requested a review from a team June 25, 2019 22:09
@ewbankkit
Copy link
Contributor Author

Rebased to remove conflicts and replaces suppressUnsetContainerAttribute with suppressMissingOptionalConfigurationBlock.

@maryelizbeth maryelizbeth added the enhancement Requests to existing resources that expand the functionality or scope. label Aug 19, 2019
@bflad
Copy link
Contributor

bflad commented Aug 29, 2019

Hi @ewbankkit 👋 Sorry for the extended delays here. We'd like to help get this functionality in the upcoming Terraform AWS Provider release next week or the week after. To expedite the process, can you please consolidate this pull request into only making the required changes (and rebasing/resubmitting if necessary)? Thanks and apologies again this has been lingering.

@bflad bflad self-assigned this Aug 29, 2019
@ewbankkit
Copy link
Contributor Author

@bflad Yes, I should be able to address this tomorrow.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 30, 2019
@ewbankkit
Copy link
Contributor Author

Closing this PR and replacing it with #9942.

@ewbankkit ewbankkit closed this Aug 30, 2019
@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Aug 30, 2019
@ewbankkit ewbankkit deleted the issue-7158 branch August 30, 2019 21:36
@ghost
Copy link

ghost commented Nov 1, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
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/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.

r/aws_s3_bucket_object: Add support for S3 Object Lock legal holds
3 participants