Resource: aws_backup_plan

Provides an AWS Backup plan resource.

Example Usage

resource "aws_backup_plan" "example" {
  name = "tf_example_backup_plan"

  rule {
    rule_name         = "tf_example_backup_rule"
    target_vault_name = aws_backup_vault.test.name
    schedule          = "cron(0 12 * * ? *)"

    lifecycle {
      delete_after = 14
    }
  }

  advanced_backup_setting {
    backup_options = {
      WindowsVSS = "enabled"
    }
    resource_type = "EC2"
  }
}

Argument Reference

This resource supports the following arguments:

Rule Arguments

rule supports the following attributes:

Lifecycle Arguments

lifecycle supports the following attributes:

Copy Action Arguments

copy_action supports the following attributes:

Advanced Backup Setting Arguments

advanced_backup_setting supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Backup Plan using the id. For example:

import {
  to = aws_backup_plan.test
  id = "<id>"
}

Using terraform import, import Backup Plan using the id. For example:

% terraform import aws_backup_plan.test <id>