Terraform-provider-aws: Include variable_tags in aws_dlm_lifecycle_policy

Created on 24 Jun 2019  路  2Comments  路  Source: hashicorp/terraform-provider-aws

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

AWS Lifecycle Manager allows the creation of "VariableTags" when creating a snapshot. This currently doesn't appear to be available and would be helpful.

New or Affected Resource(s)

  • aws_dlm_lifecycle_policy

Potential Terraform Configuration

resource "aws_dlm_lifecycle_policy" "example" {
  description        = "example DLM lifecycle policy"
  execution_role_arn = "${aws_iam_role.dlm_lifecycle_role.arn}"
  state              = "ENABLED"

  policy_details {
    resource_types = ["VOLUME"]

    schedule {
      name = "2 weeks of daily snapshots"

      create_rule {
        interval      = 24
        interval_unit = "HOURS"
        times         = ["23:45"]
      }

      retain_rule {
        count = 14
      }

      tags_to_add = {
        SnapshotCreator = "DLM"
      }

      variable_tags = {
        instance_id = "$(instance-id)"
        timestamp = "$(timestamp)"
      }

      copy_tags = false
    }

    target_tags = {
      Snapshot = "true"
    }
  }
}

References

https://docs.aws.amazon.com/cli/latest/reference/dlm/create-lifecycle-policy.html

enhancement servicdlm

Most helpful comment

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

Docs above state that variable_tags is supported only when the resource_type is INSTANCE.

And the current terraform docs say that :

resource_types - (Required) A list of resource types that should be targeted by the lifecycle policy. VOLUME is currently the only allowed value.  

This is not entirely true.

I had no issue using INSTANCE right now (v2.26.0) but variable_tags is indeed missing.

All 2 comments

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

Docs above state that variable_tags is supported only when the resource_type is INSTANCE.

And the current terraform docs say that :

resource_types - (Required) A list of resource types that should be targeted by the lifecycle policy. VOLUME is currently the only allowed value.  

This is not entirely true.

I had no issue using INSTANCE right now (v2.26.0) but variable_tags is indeed missing.

I've raised #14348 based on the syntax above. Happy to change it to support a different syntax if there's a preference.

Was this page helpful?
0 / 5 - 0 ratings