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

fix: Set max # of lifecycle_policy blocks to 3 to allow setting all policies #35522

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Jan 28, 2024

Description

This PR is to fix the maximum number of lifecycle_policy config blocks to allow all 3 supported types of policies in the aws_efs_file_system resource. While working on the fix, I noticed that the resource doc was a bit outdated, so I have adjusted the formatting and the valid values.

I also noticed that file system protection now supports a "REPLICATING" value, but the code seems to be written in a way to exclude that value. I am not sure if that was the intention, so I will open a new issue later to track the investigation. For now let's stick to fixing lifecycle policy in this PR.

Relations

Closes #35314

References

Referred to LifecyclePolicy API data type reference for supported values.

Output from Acceptance Testing

$ make testacc TESTS=TestAccEFSFileSystem_ PKG=efs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20 -run='TestAccEFSFileSystem_'  -timeout 360m
=== RUN   TestAccEFSFileSystem_basic
=== PAUSE TestAccEFSFileSystem_basic
=== RUN   TestAccEFSFileSystem_disappears
=== PAUSE TestAccEFSFileSystem_disappears
=== RUN   TestAccEFSFileSystem_performanceMode
=== PAUSE TestAccEFSFileSystem_performanceMode
=== RUN   TestAccEFSFileSystem_protection
=== PAUSE TestAccEFSFileSystem_protection
=== RUN   TestAccEFSFileSystem_availabilityZoneName
=== PAUSE TestAccEFSFileSystem_availabilityZoneName
=== RUN   TestAccEFSFileSystem_tags
=== PAUSE TestAccEFSFileSystem_tags
=== RUN   TestAccEFSFileSystem_kmsKey
=== PAUSE TestAccEFSFileSystem_kmsKey
=== RUN   TestAccEFSFileSystem_kmsWithoutEncryption
=== PAUSE TestAccEFSFileSystem_kmsWithoutEncryption
=== RUN   TestAccEFSFileSystem_provisionedThroughputInMibps
=== PAUSE TestAccEFSFileSystem_provisionedThroughputInMibps
=== RUN   TestAccEFSFileSystem_throughputMode
=== PAUSE TestAccEFSFileSystem_throughputMode
=== RUN   TestAccEFSFileSystem_lifecyclePolicy
=== PAUSE TestAccEFSFileSystem_lifecyclePolicy
=== CONT  TestAccEFSFileSystem_basic
=== CONT  TestAccEFSFileSystem_kmsKey
=== CONT  TestAccEFSFileSystem_lifecyclePolicy
=== CONT  TestAccEFSFileSystem_throughputMode
=== CONT  TestAccEFSFileSystem_provisionedThroughputInMibps
=== CONT  TestAccEFSFileSystem_kmsWithoutEncryption
=== CONT  TestAccEFSFileSystem_protection
=== CONT  TestAccEFSFileSystem_tags
=== CONT  TestAccEFSFileSystem_availabilityZoneName
=== CONT  TestAccEFSFileSystem_performanceMode
=== CONT  TestAccEFSFileSystem_disappears
--- PASS: TestAccEFSFileSystem_kmsWithoutEncryption (69.80s)
--- PASS: TestAccEFSFileSystem_performanceMode (159.09s)
--- PASS: TestAccEFSFileSystem_disappears (164.27s)
--- PASS: TestAccEFSFileSystem_basic (191.50s)
--- PASS: TestAccEFSFileSystem_availabilityZoneName (191.57s)
--- PASS: TestAccEFSFileSystem_kmsKey (192.44s)
--- PASS: TestAccEFSFileSystem_throughputMode (231.10s)
--- PASS: TestAccEFSFileSystem_protection (233.49s)
--- PASS: TestAccEFSFileSystem_provisionedThroughputInMibps (238.36s)
--- PASS: TestAccEFSFileSystem_tags (318.13s)
--- PASS: TestAccEFSFileSystem_lifecyclePolicy (341.10s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/efs        341.489s
$

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/efs Issues and PRs that pertain to the efs service. labels Jan 28, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 28, 2024
@acwwat acwwat force-pushed the b-aws_efs_file_system-fix_max_lc_policy branch from 1ca799c to dc2da95 Compare January 28, 2024 05:29
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jan 29, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccEFSFileSystem_lifecyclePolicy' PKG=efs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20  -run=TestAccEFSFileSystem_lifecyclePolicy -timeout 360m
=== RUN   TestAccEFSFileSystem_lifecyclePolicy
=== PAUSE TestAccEFSFileSystem_lifecyclePolicy
=== CONT  TestAccEFSFileSystem_lifecyclePolicy
--- PASS: TestAccEFSFileSystem_lifecyclePolicy (121.65s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/efs	145.656s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 58da3e9 into hashicorp:main Jan 29, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.35.0 milestone Jan 29, 2024
Copy link

github-actions bot commented Feb 2, 2024

This functionality has been released in v5.35.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!

@acwwat acwwat deleted the b-aws_efs_file_system-fix_max_lc_policy branch February 3, 2024 05:41
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
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 Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/efs Issues and PRs that pertain to the efs 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.

[Bug]: Unable to set all 3 EFS lifecycle policies
3 participants