-
Notifications
You must be signed in to change notification settings - Fork 0
/
dx.tf
45 lines (36 loc) · 1.1 KB
/
dx.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# --- AWS DIRECT CONNECT ---
resource "aws_dx_connection_confirmation" "this" {
connection_id = local.aws_dx_connection_id
}
resource "aws_dx_gateway" "this" {
depends_on = [aws_dx_connection_confirmation.this]
name = local.name_prefix
amazon_side_asn = "64512" // default Amazon ASN
}
resource "aws_dx_private_virtual_interface" "this" {
connection_id = local.aws_dx_connection_id
name = local.name_prefix
vlan = local.aws_dx_vif_vlan
address_family = "ipv4"
bgp_asn = equinix_fabric_cloud_router.this.equinix_asn
dx_gateway_id = aws_dx_gateway.this.id
}
resource "aws_default_vpc" "this" {
tags = {
Name = "Default VPC"
}
}
resource "aws_vpn_gateway" "this" {
vpc_id = aws_default_vpc.this.id
tags = {
Name = local.name_prefix
}
}
resource "aws_vpn_gateway_route_propagation" "this" {
vpn_gateway_id = aws_vpn_gateway.this.id
route_table_id = aws_default_vpc.this.default_route_table_id
}
resource "aws_dx_gateway_association" "this" {
dx_gateway_id = aws_dx_gateway.this.id
associated_gateway_id = aws_vpn_gateway.this.id
}