hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.85k stars 9.19k forks source link

[Enhancement]: Add support for archive_rule schedule for dlm_lifecycle_policy #28218

Open mazjindeel-code42 opened 1 year ago

mazjindeel-code42 commented 1 year ago

Description

Per the AWS DLM documentation, Data Lifecycle Manager supports archiving snapshots on one schedule per policy. I would like to see this added to the provider.

...
"ArchiveRule": { 
               "RetainRule": { 
                  "RetentionArchiveTier": { 
                     "Count": number,
                     "Interval": number,
                     "[Interval](https://docs.aws.amazon.com/dlm/latest/APIReference/API_RetentionArchiveTier.html#dlm-Type-RetentionArchiveTier-Interval)Unit": "string"
                  }
               }
            },
...

Affected Resource(s) and/or Data Source(s)

aws_dlm_lifecycle_policy

Potential Terraform Configuration

resource "aws_dlm_lifecycle_policy" "example" {
  description        = "example DLM lifecycle policy"
  policy_details {
    resource_types = ["VOLUME"]

    schedule {

      create_rule {
        interval      = 1
        interval_unit = "MONTHS"
      }

      retain_rule {
        # Instantly archive snapshot
        interval      = 0
        interval_unit = "DAYS"
      }

      archive_rule {
        retain_rule {
          retention_archive_tier {
            interval      = "90"
            interval_unit = "DAYS"
          }
        }
      }
    }    
  }
}


### References

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-ami-policy.html
https://docs.aws.amazon.com/dlm/latest/APIReference/API_CreateLifecyclePolicy.html
https://docs.aws.amazon.com/dlm/latest/APIReference/API_ArchiveRule.html
https://docs.aws.amazon.com/dlm/latest/APIReference/API_RetentionArchiveTier.html

### Would you like to implement a fix?

No
github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

mazjindeel-code42 commented 1 year ago

This would also require an update allowing us to set RetainRule.Count to zero.

csmith-infotech commented 5 days ago

Just went to build out a new DLM policy using the archiving feature and couldn't find any indication that the provider supported it. Guess this is why :)

Any chance this enhancement can get bumped? This DLM feature is around 2 years old.