echomike80 / terraform-aws-backup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS Backup Terraform module

Terraform module which creates an AWS Backup vault, plan, selection and rules on AWS.

Terraform versions

Terraform 0.12 and newer.

Usage

module "backup_daily" {
  source            = "/path/to/terraform-aws-backup"

  name              = format("bkp-%s-daily", var.name)
  create_role       = true
  plan_delete_after = 30
  plan_schedule     = "cron(0 3 * * ? *)"
  plan_tag_key      = "Backup"
  plan_tag_value    = "daily"
  role_name         = format("rl-%s-ec2-backup-daily", var.name, local.environment)
}

Requirements

Name Version
terraform >= 0.12.6
aws >= 2.65

Providers

Name Version
aws >= 2.65

Modules

No modules.

Resources

Name Type
aws_backup_plan.this resource
aws_backup_selection.this resource
aws_backup_vault.this resource
aws_iam_role.this resource
aws_iam_role_policy_attachment.backup resource
aws_iam_role_policy_attachment.restores resource
aws_caller_identity.current data source

Inputs

Name Description Type Default Required
create_role Create IAM role for AWS backup bool true no
enabled Enable or disable AWS Backup bool true no
name Name to be used on all resources as prefix string n/a yes
plan_cold_storage_after Specifies the number of days after creation that a recovery point is moved to cold storage number null no
plan_delete_after Specifies the number of days after creation that a recovery point is deleted. Must be 90 days greater than cold_storage_after number null no
plan_schedule AWS Backup plan schedule string "cron(0 3 * * ? *)" no
plan_tag_key AWS Backup selection tag key string "Backup" no
plan_tag_value AWS Backup selection tag value string "enabled" no
plan_windows_vss AWS Backup plan Windows VSS feature string "disabled" no
resource_type Resource type to backup string "enabled" no
role_name Name of the IAM role which will be created when enabled is true and create_role is true string "ec2-backup-role" no
tags A mapping of backup tags to assign to the resource map(string) {} no
vault_kms_key_arn AWS Backup vault KMS key arn string null no

Outputs

No outputs.

Authors

Module managed by Marcel Emmert.

License

Apache 2 Licensed. See LICENSE for full details.

About


Languages

Language:HCL 100.0%