提供者:AWS
地区:us-east-1
地形:v1.0.4
尝试创建路由表时:
resource "aws_vpc_endpoint_route_table_association" "dynamodb_route_table" {
count = "${length(module.vpc.private_route_table_ids)}"
vpc_endpoint_id = aws_vpc_endpoint.dynamodb_connection.id
route_table_id = "${element(module.vpc.private_route_table_ids, count.index)}"
depends_on = [aws_vpc_endpoint.dynamodb_connection]
}
使用以下路线:
resource "aws_route" "subnet_to_vpce" {
count = "${length(module.vpc.private_route_table_ids)}"
route_table_id = "${element(module.vpc.private_route_table_ids, count.index)}"
vpc_endpoint_id = aws_vpc_endpoint.dynamodb_connection.id
destination_cidr_block = "${element(module.vpc.private_subnets_cidr_blocks, count.index)}"
depends_on = [aws_vpc_endpoint.dynamodb_connection]
}
它引用以下列方式创建的 vpc 端点:
resource "aws_vpc_endpoint" "dynamodb_connection" {
vpc_id = module.vpc.vpc_id
service_name = "com.amazonaws.${var.aws_region}.dynamodb"
policy = <<POLICY
{
"Statement": [
{
"Action": "*",
"Effect": "Allow",
"Resource": "*",
"Principal": "*"
}
]
}
POLICY
}
我收到以下错误:
Error: error creating Route in Route Table (rtb-xxxxxxxxxxxxxxxxx) with destination (10.xx.x.x/24): InvalidVpcEndpointId.NotFound: The vpcEndpoint ID 'vpce-xxxxxxxxxxxxxxxxx' does not exist.
但是,vpc 端点本身已成功创建。我在 tfstate 文件中看到它,当我登录到 AWS 控制台并检查时,我可以看到 vpc 端点具有在错误中找到的确切 ID。
我等了一个小时后重试,但仍然没有。
不知道我做错了什么或者这是一个错误。