0

是否terraform支持aws跨区域复制的备份功能(https://www.terraform.io/docs/providers/aws/r/backup_plan.html)?

当我阅读文档时,我可以看到它确实支持。

但我收到以下错误:

错误:backup_plan.tf 第 11 行不支持的参数,在资源“aws_backup_plan”“示例”中:11:copy_action = { 此处不需要名为“copy_action”的参数。

我的terraform文件供您参考

resource "aws_backup_plan" "example" {
    name = "example-plan"
    rule {
        rule_name = "MainRule"
        target_vault_name = "primary"
        schedule = "cron(5 8 * * ? *)"
        start_window = 480
        completion_window = 10080
        lifecycle {
            delete_after = 30
        }
        copy_action {
            destination_vault_arn = "arn:aws:backup:us-west-2:123456789:backup-vault:secondary"
        }
    }
}

但是当我删除块

copy_action {
            destination_vault_arn = "arn:aws:backup:us-west-2:123456789:backup-vault:secondary"
        }

它工作得很好

谢谢

4

1 回答 1

1

我假设您正在运行 2.57.0 或更早版本的 Terraform AWS Provider。

2.58.0 版(3 天前发布)支持copy_action

resource/aws_backup_plan:添加规则配置块copy_action配置块(支持跨区域复制)

您可以在代码中指定至少需要此版本,如下所示:

provider "aws" {
  version = "~> 2.58.0"
}
于 2020-04-19T18:25:06.943 回答