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

r/aws_s3_bucket: Support S3 Object Lock #6964

Merged
merged 2 commits into from
Jan 16, 2019
Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Dec 21, 2018

Fixes #6872.

Syntax:

resource "aws_s3_bucket" "foo" {
  bucket = "my-versioning-bucket"
  acl    = "private"

  object_lock_configuration {
    object_lock_enabled = "Enabled"

    rule {
      default_retention {
        mode = "GOVERNANCE"
        days = 30
      }
    }
  }
}

@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/s3 Issues and PRs that pertain to the s3 service. documentation Introduces or discusses updates to documentation. labels Dec 21, 2018
@ewbankkit
Copy link
Contributor Author

Pushing initial work as I will be OOTO for the next 2 weeks.

@ghost ghost added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Jan 12, 2019
@ewbankkit
Copy link
Contributor Author

Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_objectLock'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3Bucket_objectLock -timeout 120m
=== RUN   TestAccAWSS3Bucket_objectLock
=== PAUSE TestAccAWSS3Bucket_objectLock
=== CONT  TestAccAWSS3Bucket_objectLock
--- PASS: TestAccAWSS3Bucket_objectLock (54.02s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	54.035s

@ewbankkit ewbankkit changed the title [WIP] r/aws_s3_bucket: Support S3 Object Lock r/aws_s3_bucket: Support S3 Object Lock Jan 12, 2019
@ewbankkit
Copy link
Contributor Author

Updates to aws_s3_bucket_object resource will be in a separate PR.
Removing WIP - @bflad now ready for review.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hey @ewbankkit 👋 This is looking pretty good! One minor attribute change and I think we might want to include some of the limitations/oddities about this configuration in the resource documentation.

aws/resource_aws_s3_bucket.go Outdated Show resolved Hide resolved
aws/resource_aws_s3_bucket.go Outdated Show resolved Hide resolved
website/docs/r/s3_bucket.html.markdown Show resolved Hide resolved
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. waiting-response Maintainers are waiting on response from community or contributor. labels Jan 15, 2019
@ewbankkit
Copy link
Contributor Author

Acceptance tests after code review changes:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_objectLock'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSS3Bucket_objectLock -timeout 120m
=== RUN   TestAccAWSS3Bucket_objectLock
=== PAUSE TestAccAWSS3Bucket_objectLock
=== CONT  TestAccAWSS3Bucket_objectLock
--- PASS: TestAccAWSS3Bucket_objectLock (59.30s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	74.381s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 15, 2019
@bflad bflad added this to the v1.56.0 milestone Jan 16, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks great, @ewbankkit, thanks! 🚀

Passes all S3 bucket acceptance testing over various runs (when eventual consistency is not acting up).

@bflad bflad merged commit 6c21807 into hashicorp:master Jan 16, 2019
bflad added a commit that referenced this pull request Jan 16, 2019
@bflad
Copy link
Contributor

bflad commented Jan 16, 2019

This has been released in version 1.56.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ewbankkit ewbankkit deleted the issue-6872 branch January 16, 2019 12:06
@ghost
Copy link

ghost commented Apr 1, 2020

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 Apr 1, 2020
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/L 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 'Governance' and 'Compliance' object retention modes for aws_s3_bucket
2 participants