Skip to content

r/aws_dlm_lifecycle_policy added support for default policy, pre/post scripts, archive rule, exclusion #41055

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

alexbacchin
Copy link
Contributor

@alexbacchin alexbacchin commented Jan 23, 2025

Description

This PR adds support a few features to support more granular and advanced Amazon Data Lifecycle Manager policies. These features are required for enterprise customers.

  • set the default policy. Added from nikhil-goenka #37796
  • define exclusion to default policy
  • define pre/post scrips to enable application consistent snapshots
  • define archival rules

Relations

Closes #35685
Closes #35450
Closes: #28218
Closes: #27110

References

https://docs.aws.amazon.com/dlm/latest/APIReference/API_CreateLifecyclePolicy.html

Output from Acceptance Testing

% make testacc TESTS=TestAccDLMLifecyclePolicy_defaultPolicy PKG=dlm
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/dlm/... -v -count 1 -parallel 20 -run='TestAccDLMLifecyclePolicy_defaultPolicy'  -timeout 360m -vet=off
2025/01/24 04:54:39 Initializing Terraform AWS Provider...
=== RUN   TestAccDLMLifecyclePolicy_defaultPolicy
=== PAUSE TestAccDLMLifecyclePolicy_defaultPolicy
=== RUN   TestAccDLMLifecyclePolicy_defaultPolicyExclusions
=== PAUSE TestAccDLMLifecyclePolicy_defaultPolicyExclusions
=== CONT  TestAccDLMLifecyclePolicy_defaultPolicy
=== CONT  TestAccDLMLifecyclePolicy_defaultPolicyExclusions
--- PASS: TestAccDLMLifecyclePolicy_defaultPolicy (28.85s)
--- PASS: TestAccDLMLifecyclePolicy_defaultPolicyExclusions (49.90s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dlm        50.007s
make testacc TESTS=TestAccDLMLifecyclePolicy_scripts PKG=dlm
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/dlm/... -v -count 1 -parallel 20 -run='TestAccDLMLifecyclePolicy_scripts'  -timeout 360m -vet=off
2025/01/24 04:56:12 Initializing Terraform AWS Provider...
=== RUN   TestAccDLMLifecyclePolicy_scriptsAlias
=== PAUSE TestAccDLMLifecyclePolicy_scriptsAlias
=== RUN   TestAccDLMLifecyclePolicy_scriptsSSMDocument
=== PAUSE TestAccDLMLifecyclePolicy_scriptsSSMDocument
=== CONT  TestAccDLMLifecyclePolicy_scriptsAlias
=== CONT  TestAccDLMLifecyclePolicy_scriptsSSMDocument
--- PASS: TestAccDLMLifecyclePolicy_scriptsSSMDocument (55.36s)
--- PASS: TestAccDLMLifecyclePolicy_scriptsAlias (58.27s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dlm        58.382s
make testacc TESTS=TestAccDLMLifecyclePolicy_archiveRule PKG=dlm
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/dlm/... -v -count 1 -parallel 20 -run='TestAccDLMLifecyclePolicy_archiveRule'  -timeout 360m -vet=off
2025/01/24 04:59:20 Initializing Terraform AWS Provider...
=== RUN   TestAccDLMLifecyclePolicy_archiveRuleCount
=== PAUSE TestAccDLMLifecyclePolicy_archiveRuleCount
=== RUN   TestAccDLMLifecyclePolicy_archiveRuleInterval
=== PAUSE TestAccDLMLifecyclePolicy_archiveRuleInterval
=== CONT  TestAccDLMLifecyclePolicy_archiveRuleCount
=== CONT  TestAccDLMLifecyclePolicy_archiveRuleInterval
--- PASS: TestAccDLMLifecyclePolicy_archiveRuleCount (29.17s)
--- PASS: TestAccDLMLifecyclePolicy_archiveRuleInterval (29.18s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dlm        29.274s

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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/dlm Issues and PRs that pertain to the dlm service. needs-triage Waiting for first response or review from a maintainer. labels Jan 23, 2025
@alexbacchin alexbacchin marked this pull request as ready for review January 23, 2025 19:04
@alexbacchin alexbacchin requested a review from a team as a code owner January 23, 2025 19:04
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jan 24, 2025
@justinretzolk justinretzolk added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 24, 2025
@alexbacchin alexbacchin changed the title feat: aws_dlm_lifecycle_policy added support for default policy, pre/post scripts, archive rule, exclusion r/aws_dlm_lifecycle_policy added support for default policy, pre/post scripts, archive rule, exclusion Jan 31, 2025
@alexbacchin
Copy link
Contributor Author

@justinretzolk Can you please let me is there any chance this PR get some attention? Last time, this service was touched was almost 1 year ago. I have combined 4 issues into 1 PR. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/dlm Issues and PRs that pertain to the dlm service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants