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 'Governance' and 'Compliance' object retention modes for aws_s3_bucket #6872

Closed
voroale opened this issue Dec 17, 2018 · 5 comments · Fixed by #6964
Closed

Add 'Governance' and 'Compliance' object retention modes for aws_s3_bucket #6872

voroale opened this issue Dec 17, 2018 · 5 comments · Fixed by #6964
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@voroale
Copy link

voroale commented Dec 17, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Hi,
As of current moment - v0.11.11 - one cannot simply configure S3 Object Lock as a part of object versioning configuration or otherwise.
Being able to set Retention Modes - Governance and Compliance is crucial for some businesses, that are prone to regulatory constraints.

Potential Terraform Configuration

Something like retention_mode in versioning section

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

  versioning {
    enabled = true
    retention_mode = "governance" // "compliance" , "generic"
  }
}
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. labels Dec 17, 2018
@ewbankkit
Copy link
Contributor

@ewbankkit
Copy link
Contributor

It looks like we will need to modify a couple of resources for full support:

Suggested syntax:

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

  object_lock_configuration {
    object_lock_enabled = true

    rule {
      default_retention {
        mode = "GOVERNANCE"
        days = 30
      }
    }
  }
}
resource "aws_s3_bucket_object" "foo" {
  bucket = "my-versioning-bucket"
  key    = "important-data.txt"

  retention {
    mode              = "GOVERNANCE"
    retain_until_date = "2020-01-05T00:00:00.000Z"
  }

  legal_hold {
    status = "ON"
  }
}

@bflad
Copy link
Contributor

bflad commented Jan 16, 2019

Support for S3 object lock configuration in the aws_s3_bucket resource has been merged and will release with version 1.56.0 of the Terraform AWS provider, likely in the next few hours.

For tracking aws_s3_bucket_object support, its probably best to create a separate feature request issue. 👍

@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.

@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
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants