Dav*_*due 2 routetable amazon-web-services terraform terraform-provider-aws
当您在 terraform 中创建 AWS VPC 时,将为其分配一个默认路由表,该路由表将在 VPC 的 CIDR 块内路由流量。
我想为此添加默认路由,以将所有其他流量发送到 Internet。
aws_route这可以通过使用将默认路由添加到现有 VPC 路由表来完成。例如:
resource "aws_vpc" "vpc" {
cidr_block = "${var.classb}.0.0/16"
}
resource "aws_intenet_gateway" "ig" {
vpc_id = "${aws_vpc.vpc.id}"
}
resource "aws_route" "simulation_default_route" {
route_table_id = "${aws_vpc.vpc.default_route_table_id}"
destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.ig.id}"
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4748 次 |
| 最近记录: |