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/bucket: add new_versions to noncurrent_version_expiration within lifecycle_rule #22680

Conversation

glenwinters
Copy link

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #22561

This adds the newer_versions attribute to the noncurrent_version_expiration block in S3 lifecycle rules.

The API docs on NoncurrentVersionExpiration use the terms NoncurrentDays and NewerNoncurrentVersions. The existing Terraform attribute is simply days so I simplified the new field to newer_versions to be similar. Let me know if you think it should be newer_noncurrent_versions to be more explicit.

Output from acceptance testing:

$ make testacc TESTS=TestAccS3Bucket_Manage_lifecycleBasic PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run='TestAccS3Bucket_Manage_lifecycleBasic'  -timeout 180m
=== RUN   TestAccS3Bucket_Manage_lifecycleBasic
=== PAUSE TestAccS3Bucket_Manage_lifecycleBasic
=== CONT  TestAccS3Bucket_Manage_lifecycleBasic
--- PASS: TestAccS3Bucket_Manage_lifecycleBasic (94.65s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/s3 94.728s
...

@github-actions github-actions bot added 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. needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. and removed documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3 Issues and PRs that pertain to the s3 service. needs-triage Waiting for first response or review from a maintainer. labels Jan 20, 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 @glenwinters 👋

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

@glenwinters glenwinters force-pushed the s3-lifecycle-newernoncurrentversions branch from 3e456c7 to cc810bb Compare January 20, 2022 09:15
@github-actions github-actions bot added 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 20, 2022
@glenwinters glenwinters changed the title s3/bucket: add new_versions to noncurrent_version_expiration s3/bucket: add new_versions to noncurrent_version_expiration within lifecycle_rule Jan 20, 2022
@gdavison gdavison self-assigned this Feb 3, 2022
@gdavison
Copy link
Contributor

gdavison commented Feb 4, 2022

Thanks for the PR, @glenwinters. As part of the upgrade to v4.0 of the AWS Provider (described in #20433), We've made a separate resource aws_s3_bucket_lifecycle_configuration to manage S3 bucket lifecycle #22579 and are making the inline bucket lifecycle in the aws_s3_bucket readonly #22581.

This enhancement would be useful to combine with the other S3 changes, so we'd like to get it out with v4.0. If you'd like to update the PR to be compatible with the changes, go ahead. Otherwise, we will make the necessary changes before the release.

@gdavison
Copy link
Contributor

gdavison commented Feb 8, 2022

Hi @glenwinters, the PR #22579 actually adds the new versions to the aws_s3_bucket_lifecycle_configuration resource, so I'm going to close this issue. Thanks again for the PR.

@gdavison gdavison closed this Feb 8, 2022
@glenwinters
Copy link
Author

glenwinters commented Feb 8, 2022

Hey @gdavison. Makes sense. Thanks for linking the new resource PR.

@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 May 25, 2022
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. service/s3 Issues and PRs that pertain to the s3 service. size/XS 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.

Support for NewerNoncurrentVersions for S3 Bucket
2 participants