如何解决AWS ECR 存储库的跨区域复制
我正在尝试使用 terraform 将我的 AWS ECR 存储库复制到同一账户内的多个区域。我从 AWS 控制台手动尝试它工作正常,但从 terraform,我无法找到解决方案。 我试过的: 我尝试为名为replicate_region 的区域创建一个单独的变量,并尝试在列表中提供该区域,但它一直给我一个名为
的错误属性“region”的不适当值:需要字符串。
这是变量代码:
variable "replicate_region" {
description = "value"
type = list(string)
}
这是我的 ecr 复制代码:
resource "aws_ecr_replication_configuration" "replication" {
replication_configuration {
rule {
destination {
region = var.replicate_region
registry_id = "xxxxxxxx"
}
}}}
有人可以帮我吗?
谢谢,
解决方法
您的 <p:column exportable="false">
<p:commandButton value="Transfer To" oncomplete="PF('transferTo').show()"
action="#{transactionBean.transferParam(accountModel)}"/>
</p:column>
应该是字符串,而不是字符串列表。应该是,例如:
replicate_region
更新
使用 dynamic block 进行迭代。
variable "replicate_region" {
description = "value"
type = string
default = "us-east-1"
}
,
更简单的方法:
resource "aws_ecr_replication_configuration" "replication" {
replication_configuration {
rule {
destination {
region = "us-east-2"
registry_id = "xxxxxxxx"
}
destination {
region = "ap-southeast-1"
registry_id = "xxxxxxxx"
}
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。