-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaws_dx.tf
47 lines (40 loc) · 1.34 KB
/
aws_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
46
47
/*
* Terraform connect resources for AWS.
*/
resource "aws_vpn_gateway" "aws-dx" {
tags = {
Terraform = "true"
Project = lower(var.project_name)
Owner = lower(var.owner)
Name = format("%s-dx-vpg", lower(var.project_name))
}
}
resource "aws_vpn_gateway_attachment" "aws-dx" {
vpc_id = aws_vpc.aws-vpc.id
vpn_gateway_id = aws_vpn_gateway.aws-dx.id
}
resource "time_sleep" "wait_vif_ready" {
depends_on = [aws_instance.aws-vm]
create_duration = "120s"
}
resource "aws_dx_private_virtual_interface" "aws-dx" {
depends_on = [time_sleep.wait_vif_ready]
connection_id = equinix_ecx_l2_connection_accepter.aws.aws_connection_id
name = format("%s-dx-vif", lower(var.project_name))
vlan = equinix_ecx_l2_connection.aws.zside_vlan_stag // Corresponds to the Equinix API parameter 'Seller-Side VLAN ID - zside_vlan_stag'
address_family = "ipv4"
bgp_asn = tostring(var.aws_dx_bgp_equinix_side_asn)
bgp_auth_key = var.aws_dx_bgp_authkey
amazon_address = var.aws_dx_bgp_amazon_address
customer_address = var.aws_dx_bgp_equinix_side_address
vpn_gateway_id = aws_vpn_gateway.aws-dx.id
tags = {
Terraform = "true"
Project = lower(var.project_name)
Owner = lower(var.owner)
}
timeouts {
create = "30m"
delete = "30m"
}
}