diff --git a/examples/cloud-router-2-aws-connection/main.tf b/examples/cloud-router-2-aws-connection/main.tf index 88640b90..ce035f9f 100644 --- a/examples/cloud-router-2-aws-connection/main.tf +++ b/examples/cloud-router-2-aws-connection/main.tf @@ -31,41 +31,34 @@ module "cloud_router_aws_connection" { zside_fabric_sp_name = var.zside_fabric_sp_name } -data "aws_dx_connection" "connection_id" { +data "aws_dx_connection" "aws_connection" { depends_on = [ module.cloud_router_aws_connection ] name = var.connection_name } -resource "aws_vpc" "example" { +resource "aws_dx_gateway" "aws_gateway" { depends_on = [ module.cloud_router_aws_connection ] - cidr_block = var.aws_vpc_cidr_block + name = var.aws_gateway_name + amazon_side_asn = var.aws_gateway_asn } -resource "aws_vpn_gateway" "example" { - depends_on = [ - module.cloud_router_aws_connection - ] - vpc_id = aws_vpc.example.id -} - -resource "aws_dx_private_virtual_interface" "example" { +resource "aws_dx_private_virtual_interface" "aws_virtual_interface" { depends_on = [ module.cloud_router_aws_connection, - aws_vpn_gateway.example, - aws_vpc.example + aws_dx_gateway.aws_gateway ] - connection_id = data.aws_dx_connection.connection_id.id + connection_id = data.aws_dx_connection.aws_connection.id name = var.aws_vif_name - vlan = var.aws_vif_vlan + vlan = data.aws_dx_connection.aws_connection.vlan_id address_family = var.aws_vif_address_family bgp_asn = var.aws_vif_bgp_asn amazon_address = var.aws_vif_amazon_address customer_address = var.aws_vif_customer_address bgp_auth_key = var.aws_vif_bgp_auth_key - vpn_gateway_id = aws_vpn_gateway.example.id + dx_gateway_id = aws_dx_gateway.aws_gateway.id } diff --git a/examples/cloud-router-2-aws-connection/outputs.tf b/examples/cloud-router-2-aws-connection/outputs.tf index 3fbdad0c..7a19ade9 100644 --- a/examples/cloud-router-2-aws-connection/outputs.tf +++ b/examples/cloud-router-2-aws-connection/outputs.tf @@ -1,13 +1,10 @@ -output "module_output" { +output "aws_connection_id" { value = module.cloud_router_aws_connection.primary_connection_id } -output "aws_vpc_id" { - value = aws_vpc.example.id -} -output "aws_vpn_gateway_id" { - value = aws_vpn_gateway.example.id +output "aws_dx_gateway_id" { + value = aws_dx_gateway.aws_gateway.id } output "aws_interface_id" { - value = aws_dx_private_virtual_interface.example.id + value = aws_dx_private_virtual_interface.aws_virtual_interface.id } diff --git a/examples/cloud-router-2-aws-connection/terraform.tfvars.example b/examples/cloud-router-2-aws-connection/terraform.tfvars.example index ca8b1cc2..54bdb790 100644 --- a/examples/cloud-router-2-aws-connection/terraform.tfvars.example +++ b/examples/cloud-router-2-aws-connection/terraform.tfvars.example @@ -20,7 +20,8 @@ additional_info = [ { key = "secretKey", value = "" } ] -aws_vpc_cidr_block = "10.255.255.0/28" +aws_gateway_name = "aws_gateway" +aws_gateway_asn = 64518 aws_vif_name = "port2aws" aws_vif_vlan = "320" aws_vif_address_family = "ipv4" diff --git a/examples/cloud-router-2-aws-connection/variables.tf b/examples/cloud-router-2-aws-connection/variables.tf index f1d990cf..a03eea9d 100644 --- a/examples/cloud-router-2-aws-connection/variables.tf +++ b/examples/cloud-router-2-aws-connection/variables.tf @@ -76,10 +76,6 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } -variable "aws_vpc_cidr_block" { - description = "The IPv4 CIDR block for the VPC" - type = string -} variable "aws_vif_name" { description = "The name for the virtual interface" type = string @@ -111,4 +107,11 @@ variable "aws_vif_bgp_auth_key" { type = string default = "" } - +variable "aws_gateway_name" { + description = "The name of the Gateway" + type = string +} +variable "aws_gateway_asn" { + description = "The ASN to be configured on the Amazon side of the connection. The ASN must be in the private range of 64,512 to 65,534 or 4,200,000,000 to 4,294,967,294" + type = number +} diff --git a/examples/port-2-aws-connection/main.tf b/examples/port-2-aws-connection/main.tf index 4f726c92..d2906ca4 100644 --- a/examples/port-2-aws-connection/main.tf +++ b/examples/port-2-aws-connection/main.tf @@ -21,7 +21,6 @@ module "port_2_aws_connection" { # A-side aside_port_name = var.aside_port_name aside_vlan_tag = var.aside_vlan_tag - aside_vlan_inner_tag = var.aside_vlan_inner_tag # Z-side zside_ap_type = var.zside_ap_type @@ -32,40 +31,33 @@ module "port_2_aws_connection" { zside_sp_name = var.zside_sp_name } -data "aws_dx_connection" "connection_id" { +data "aws_dx_connection" "aws_connection" { depends_on = [ module.port_2_aws_connection ] name = var.connection_name } -resource "aws_vpc" "example" { - depends_on = [ - module.port_2_aws_connection - ] - cidr_block = var.aws_vpc_cidr_block -} -resource "aws_vpn_gateway" "example" { +resource "aws_dx_gateway" "aws_gateway" { depends_on = [ module.port_2_aws_connection ] - vpc_id = aws_vpc.example.id + name = var.aws_gateway_name + amazon_side_asn = var.aws_gateway_asn } -resource "aws_dx_private_virtual_interface" "example" { +resource "aws_dx_private_virtual_interface" "aws_virtual_interface" { depends_on = [ module.port_2_aws_connection, - aws_vpn_gateway.example, - aws_vpc.example + aws_dx_gateway.aws_gateway ] - - connection_id = data.aws_dx_connection.connection_id.id + connection_id = data.aws_dx_connection.aws_connection.id name = var.aws_vif_name - vlan = var.aws_vif_vlan + vlan = data.aws_dx_connection.aws_connection.vlan_id address_family = var.aws_vif_address_family bgp_asn = var.aws_vif_bgp_asn amazon_address = var.aws_vif_amazon_address customer_address = var.aws_vif_customer_address bgp_auth_key = var.aws_vif_bgp_auth_key - vpn_gateway_id = aws_vpn_gateway.example.id + dx_gateway_id = aws_dx_gateway.aws_gateway.id } diff --git a/examples/port-2-aws-connection/outputs.tf b/examples/port-2-aws-connection/outputs.tf index 94495b28..e119ef71 100644 --- a/examples/port-2-aws-connection/outputs.tf +++ b/examples/port-2-aws-connection/outputs.tf @@ -1,12 +1,9 @@ output "aws_connection_id" { value = module.port_2_aws_connection.primary_connection_id } -output "aws_vpc_id" { - value = aws_vpc.example.id -} -output "aws_vpn_gateway_id" { - value = aws_vpn_gateway.example.id +output "aws_dx_gateway_id" { + value = aws_dx_gateway.aws_gateway.id } output "aws_interface_id" { - value = aws_dx_private_virtual_interface.example.id + value = aws_dx_private_virtual_interface.aws_virtual_interface.id } diff --git a/examples/port-2-aws-connection/terraform.tfvars.example b/examples/port-2-aws-connection/terraform.tfvars.example index 6662bd47..7a653619 100644 --- a/examples/port-2-aws-connection/terraform.tfvars.example +++ b/examples/port-2-aws-connection/terraform.tfvars.example @@ -21,7 +21,8 @@ additional_info = [ { key = "secretKey", value = "" } ] -aws_vpc_cidr_block = "10.255.255.0/28" +aws_gateway_name = "aws_gateway" +aws_gateway_asn = 64518 aws_vif_name = "port2aws" aws_vif_vlan = "320" aws_vif_address_family = "ipv4" diff --git a/examples/port-2-aws-connection/variables.tf b/examples/port-2-aws-connection/variables.tf index a1f58f76..1da2dda3 100644 --- a/examples/port-2-aws-connection/variables.tf +++ b/examples/port-2-aws-connection/variables.tf @@ -36,7 +36,6 @@ variable "aside_port_name" { description = "Equinix A-Side Port Name" type = string } - variable "aside_vlan_tag" { description = "Vlan Tag information, outer vlanSTag for QINQ connections" type = string @@ -75,10 +74,6 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } -variable "aws_vpc_cidr_block" { - description = "The IPv4 CIDR block for the VPC" - type = string -} variable "aws_vif_name" { description = "The name for the virtual interface" type = string @@ -110,4 +105,11 @@ variable "aws_vif_bgp_auth_key" { type = string default = "" } - +variable "aws_gateway_name" { + description = "The name of the Gateway" + type = string +} +variable "aws_gateway_asn" { + description = "The ASN to be configured on the Amazon side of the connection. The ASN must be in the private range of 64,512 to 65,534 or 4,200,000,000 to 4,294,967,294" + type = number +}