【发布时间】:2022-09-30 12:20:21
【问题描述】:
我正在尝试在两个不同账户中的两个 VPC 之间创建 VPC 对等互连。一个由我管理,另一个由其他人管理,我无权访问它。 我正在使用 Terraform 脚本的下一个 sn-p。
resource \"aws_vpc_peering_connection\" \"a\" {
peer_owner_id = var.a.aws_account_id
peer_vpc_id = var.a.vpc_id
vpc_id = aws_vpc.main.id
peer_region = \"eu-west-1\"
requester {
allow_remote_vpc_dns_resolution = false
}
}
接下来,管理该帐户的人将手动接受它。
问题是 Peering 是否被接受 Terraform 想要 replace 那个 Peering 连接:
# module.vpc.aws_vpc_peering_connection.a is tainted, so must be replaced
-/+ resource \"aws_vpc_peering_connection\" \"a\" {
~ accept_status = \"active\" -> (known after apply)
~ id = \"pcx-00000000000000000\" -> (known after apply)
# (5 unchanged attributes hidden)
+ accepter {
+ allow_classic_link_to_remote_vpc = (known after apply)
+ allow_remote_vpc_dns_resolution = (known after apply)
+ allow_vpc_to_remote_classic_link = (known after apply)
}
# (1 unchanged block hidden)
}
我已经尝试使用lifecycle 来阻止替换
lifecycle {
ignore_changes = all
}
但这无济于事...
标签: amazon-web-services terraform terraform-provider-aws aws-vpc-peering vpc-peering