我正在尝试有条件地创建NACL:
resource "aws_network_acl" "allow_ssh_from_world" {
vpc_id = aws_vpc.main.id
subnet_ids = [ aws_subnet.main.id ]
count = var.allow_ssh_from_world == true ? 1 : 0
...
}
但是,当我将其设置为true
时,会出现以下错误:
module.network.aws_network_acl.allow_ssh_from_world[0]: Creating...
Error: InvalidAssociationID.NotFound: The association ID 'xxxxx' does not exist
status code: 400, request id: xxxxx
on modules/module-network/main-nacl.tf line 44, in resource "aws_network_acl" "allow_ssh_from_world":
44: resource "aws_network_acl" "allow_ssh_from_world" {
这种方法是否有条件地创建了Terraform支持的NACL?
更新:我刚刚发现此问题:https://github.com/terraform-providers/terraform-provider-aws/issues/12152,但没有解决方法。