我正在使用Terraform在AWS上启动我的基础架构并将状态保存在.tfstate文件中。在我的应用程序中,我必须VPN到其他网络,其他网络的管理员已经在IPSec ESP连接上定义了我必须遵守的VPN连接上的参数。
使用Terraform我尽可能地使用远程网络的参数创建VPN网关和客户网关。然后我创建一个VPN连接和适当的路由。这是我在Terraform中的VPN代码:
resource "aws_vpn_gateway" "vpn_gw" {
vpc_id = "${aws_vpc.default.id}"
tags {
Name = "default"
Terraform = true
}
}
resource "aws_customer_gateway" "customer_gw" {
bgp_asn = 65000
ip_address = "172.0.0.1"
type = "ipsec.1"
}
resource "aws_vpn_connection" "default" {
vpn_gateway_id = "${aws_vpn_gateway.vpn_gw.id}"
customer_gateway_id = "${aws_customer_gateway.customer_gw.id}"
type = "ipsec.1"
static_routes_only = true
}
resource "aws_vpn_connection_route" "office" {
destination_cidr_block = "192.168.10.0/24"
vpn_connection_id = "${aws_vpn_connection.default.id}"
}
我必须能够在我的VPN隧道上为连接的第1阶段和第2阶段设置以下参数:
第1阶段
第2阶段
VPN Customer Gateway上的文档显示您无法自行设置这么多参数:https://www.terraform.io/docs/providers/aws/r/customer_gateway.html Boto API也不允许设置任何其他参数。
有没有办法设置这些参数(以编程方式)?
答案 0 :(得分:0)
不幸的是,你的问题的答案是否定的。这不是Terraform问题,因此,这是AWS提供的服务的限制。您没有使用AWS的基本解决方案获得该级别的配置。
要实现您的目标,您需要启动EC2实例并