This commit is contained in:
2023-01-22 03:27:54 +09:00
parent d3f56ecc0c
commit 09e9dcf9b5
28 changed files with 188 additions and 247 deletions

17
modules/vpn_conn/main.tf Normal file
View File

@ -0,0 +1,17 @@
resource "aws_vpn_connection" "example" {
customer_gateway_id = var.cgw_id
transit_gateway_id = var.tgw_id
type = "ipsec.1"
tunnel1_preshared_key = var.preshared_key
tunnel2_preshared_key = var.preshared_key
static_routes_only = true
tags = {
Name = "terraform_ipsec_vpn_example"
}
}
# outside_ip_address_type = "PrivateIpv4"
# transport_transit_gateway_attachment_id = data.aws_ec2_transit_gateway_dx_gateway_attachment.example.id

View File

@ -0,0 +1,10 @@
output "vpn_conn_tunnel-1_ip" {
value = aws_vpn_connection.example.tunnel1_address
}
output "vpn_conn_tunnel-2_ip" {
value = aws_vpn_connection.example.tunnel2_address
}
output "attach_id" {
value = aws_vpn_connection.example.transit_gateway_attachment_id
}

View File

@ -0,0 +1,13 @@
variable "cgw_id" {
type = string
}
variable "tgw_id" {
type = string
}
variable "preshared_key" {
type = string
}