diff --git a/modules/dlm-lifecycle-iam-role/README.md b/modules/dlm-lifecycle-iam-role/README.md new file mode 100644 index 00000000..301fa445 --- /dev/null +++ b/modules/dlm-lifecycle-iam-role/README.md @@ -0,0 +1,15 @@ +## Data Lifecycle Manager (DLM) lifecycle policy for managing snapshots + +This module creates the IAM role and the policy that allows the AWS Data Lifecycle Manager to create snapshots. + +### Example how to use + +Define variables + +``` +module "ebs-backup-policy" { + source = "github.com/fpco/terraform-aws-foundation//modules/dlm-lifecycle-iam" + + iam_role_name = "dlm-lifecycle-role" +} +``` diff --git a/modules/dlm-lifecycle-iam-role/main.tf b/modules/dlm-lifecycle-iam-role/main.tf new file mode 100644 index 00000000..581292e8 --- /dev/null +++ b/modules/dlm-lifecycle-iam-role/main.tf @@ -0,0 +1,56 @@ +variable "iam_role_name" { + description = "The IAM role name for the DLM lifecyle policy" + type = string + default = "dlm-lifecycle-role" +} + +# Create the iam role +resource "aws_iam_role" "dlm_lifecycle_role" { + name = var.iam_role_name + assume_role_policy = <