BorisLabs/terraform-aws-directconnect
Terraform module to setup AWS Direct Connect resources
AWS Direct Connect Terraform Module
Terraform module which creates Direct Connect resources on AWS.
This module aims to provide all connotations of a Direct Connect setup for AWS.
Usage
module "gateway_and_attached_vif" {
source = "BorisLabs/directconnect/aws"
version = "0.0.1"
create_dx_gateway = true
dx_gateway_name = "dx-gw-01"
dx_gateway_bgp_asn = "65300"
create_dx_private_vif = true
dx_connection_id = "dxcon-1234abcd"
dx_private_vif_name = "dx-private-vif-01-01-a"
dx_private_vif_address_family = "ipv4"
dx_private_vif_customer_address = "169.254.254.102/30"
dx_private_vif_amazon_address = "169.254.254.101/30"
dx_private_vif_bgp_asn = "65200"
dx_private_vif_vlan_id = "200"
dx_private_vif_tags = {
Gateway = "dx-gw-01"
Enviroment = "Development"
}
}Examples
- Single VIF
- DX Connection
- VIF attached to pre-existing DX Gateway
- Complete Terragrunt for DX Conn, GW, VIF -- COMING SOON
Terraform Versions
This module supports Terraform v0.12 starting at version v0.1.0.
For Terraform v0.11 support please use v0.0.2
Authors
Module managed by
Rob Houghton
Josh Sinfield
Ben Arundel
Notes
Requirements
The following requirements are needed by this module:
- terraform (>= 0.14)
Providers
The following providers are used by this module:
Modules
No modules.
Resources
The following resources are used by this module:
- aws_dx_bgp_peer.this (resource)
- aws_dx_connection.this (resource)
- aws_dx_connection_association.this (resource)
- aws_dx_gateway.this (resource)
- aws_dx_gateway_association.cross_account (resource)
- aws_dx_gateway_association.this (resource)
- aws_dx_gateway_association_proposal.this (resource)
- aws_dx_hosted_private_virtual_interface.private_vif (resource)
- aws_dx_hosted_private_virtual_interface_accepter.private_vif_accepter (resource)
- aws_dx_lag.this (resource)
- aws_dx_private_virtual_interface.this (resource)
- aws_dx_public_virtual_interface.this (resource)
- aws_vpn_gateway.this (resource)
- aws_caller_identity.this (data source)
- aws_dx_gateway.this (data source)
Required Inputs
No required inputs.
Optional Inputs
The following input variables are optional (have default values):
associate_dx_gateway
Description: Associate a DX Gateway
Type: bool
Default: false
attach_vgw
Description: Ability to attach an already existing VGW as appose to create one.
Type: bool
Default: false
create_bgp_peer
Description: Creates a BGP Peer resource
Type: bool
Default: false
create_dx_connection
Description: Create a DX Connection
Type: bool
Default: false
create_dx_gateway
Description: Create a DX Gateway
Type: bool
Default: false
create_dx_lag
Description: Creates a LAG Group
Type: bool
Default: false
create_dx_private_hosted_vif
Description: Create a DX Private Hosted Virtual Interface
Type: bool
Default: false
create_dx_private_vif
Description: Create a DX Private Virtual Interface
Type: bool
Default: false
create_dx_public_vif
Description: Create a DX Public Virtual Interface
Type: bool
Default: false
create_vgw
Description: Ability to create a VGW required for DX gateway
Type: bool
Default: false
crossaccount_dx_gateway
Description: Create a Cross Account DX Proposal & acceptance conflicts with associate_dx_gateway
Type: bool
Default: false
dx_bgp_auth_key
Description: Auth key for BGP configuration
Type: string
Default: null
dx_bgp_customer_address
Description: Customer BGP Address, required for Public VIF
Type: string
Default: null
dx_bgp_peer_addess_family
Description: Address family for BGP Peer IPV4 / IPV6
Type: string
Default: "ipv4"
dx_bgp_peer_asn
Description: BGP ASN Number
Type: number
Default: 65535
dx_bgp_virtual_interface_id
Description: Virutal interface to attach the peer to
Type: string
Default: null
dx_connection_bandwith
Description: DX Connection Bandwidth depends on location if all speeds are available
Type: string
Default: "1Gbps"
dx_connection_encryption_mode
Description: The connection MAC Security (MACsec) encryption mode
Type: string
Default: null
dx_connection_id
Description: ID Of the DX Connection
Type: string
Default: null
dx_connection_location
Description: AWS Direct connect location
Type: string
Default: "EqLD5"
dx_connection_name
Description: Name of the DX Connection
Type: string
Default: null
dx_connection_provider
Description: The name of the service provider i.e. Colt / Equinex
Type: string
Default: null
dx_connection_request_macsec
Description: Optional attribute to allow the connection to support MAC Security, supported on 10 & 100Gbps connections
Type: bool
Default: false
dx_connection_skip_destroy
Description: Set to true if you don't want Terraform to delete the connection on destroy
Type: bool
Default: false
dx_connection_tags
Description: Tags for DX Connection
Type: map(string)
Default: {}
dx_gateway_bgp_asn
Description: BGP ASN For DX Gateway
Type: number
Default: 65534
dx_gateway_id
Description: A direct gateway Id
Type: string
Default: null
dx_gateway_name
Description: DX Gateway name
Type: string
Default: "dx-gateway-default-name"
dx_gateway_owner_account_id
Description: The owning account of the AWS Direct connect Gateway
Type: string
Default: null
dx_lag_id
Description: ID of LAG Group which can be used to create a VIF on
Type: string
Default: null
dx_lag_name
Description: Name of the Lag group
Type: string
Default: null
dx_lag_tags
Description: Tags to associate with a Lag Group
Type: map(string)
Default: {}
dx_private_hosted_vif_address_family
Description: The address familty for the BGP Peer ipv4 or ipv6
Type: string
Default: "ipv4"
dx_private_hosted_vif_amazon_address
Description: Optional IPV4 CIDR address to use to send traffic to AWS Amazon. Required for IPV4 BGP peers
Type: string
Default: "169.254.254.1/30"
dx_private_hosted_vif_bgp_asn
Description: BGP ASN for client Hosted VIF
Type: number
Default: 65001
dx_private_hosted_vif_customer_address
Description: Optional IPV4 CIDR address to use to which Amazon should send traffic. Required for IPV4 BGP Peers
Type: string
Default: "169.254.254.2/30"
dx_private_hosted_vif_name
Description: The name of the Private hosted VIF
Type: string
Default: null
dx_private_hosted_vif_owner_account_id
Description: The AWS account that will own the new virtual interface.
Type: string
Default: null
dx_private_hosted_vif_vlan_id
Description: The VLAN ID to use on the hosted Virtual interface
Type: number
Default: 4093
dx_private_vif_address_family
Description: The Address Family for the BGP Peer ipv4 or ipv6
Type: string
Default: "ipv4"
dx_private_vif_amazon_address
Description: Optional IPV4 CIDR address to use to send traffic to AWS Amazon. Required for IPV4 BGP peers
Type: string
Default: "169.254.254.253/30"
dx_private_vif_bgp_asn
Description: BGP ASN for Client VIF
Type: number
Default: 65000
dx_private_vif_customer_address
Description: Optional IPV4 CIDR Address to use for customer side of the DX VIF
Type: string
Default: "169.254.254.254/30"
dx_private_vif_name
Description: Name of the Virtual Interface
Type: string
Default: "this-is-a-default-name"
dx_private_vif_tags
Description: Tags to be applied to a Private VIF !!! Not Hosted Private VIF
Type: map(string)
Default: {}
dx_private_vif_vlan_id
Description: The VLAN ID to use on the virtual interface
Type: number
Default: 4094
dx_public_vif_address_family
Description: The Address Family for the BGP Peer ipv4 or ipv6
Type: string
Default: "ipv4"
dx_public_vif_amazon_address
Description: Optional IPV4 CIDR address to use to send traffic to AWS Amazon. Required for IPV4 BGP peers
Type: string
Default: "169.254.254.253/30"
dx_public_vif_bgp_asn
Description: BGP ASN for Client VIF
Type: number
Default: 65000
dx_public_vif_bgp_auth_key
Description: Auth key for BGP Configuration
Type: string
Default: null
dx_public_vif_customer_address
Description: Optional IPV4 CIDR Address to use for customer side of the DX VIF
Type: string
Default: "169.254.254.254/30"
dx_public_vif_name
Description: Name of the Virtual Interface
Type: string
Default: "this-is-a-default-name"
dx_public_vif_route_filter_prefixes
Description: A List of routes to be advertised to the AWS Network in this Region
Type: list(string)
Default: []
dx_public_vif_tags
Description: Tags to be applied to a Private VIF !!! Not Hosted Private VIF
Type: map(string)
Default: {}
dx_public_vif_vlan_id
Description: The VLAN ID to use on the virtual interface
Type: number
Default: 4094
lookup_gateway
Description: Find a gateway to use when associating a VIF to a Gateway conflicts with create DX Gateway
Type: bool
Default: false
mtu_size
Description: MTU size for the interface supports 1500 or 9001 (Jumbo)
Type: number
Default: 1500
network_cidr
Description: Network base address to calculate IPs
Type: string
Default: "169.254.254.0/24"
vgw_id
Description: AWS ID of the Virtual Private Gateway if attaching one use in conjunction with attach VGW
Type: string
Default: null
vgw_tags
Description: Tags for VGW Resource
Type: map(string)
Default: {}
vpc_id
Description: Required if you are creating and attach DX & VGW
Type: string
Default: null
Outputs
The following outputs are exported:
dx_connection_arn
Description: The ARN of the connection
dx_connection_bandwidth
Description: Bandwidth of the connection
dx_connection_id
Description: The ID of the connection
dx_connection_name
Description: The connection name
dx_gateway_id
Description: The ID of the gateway
dx_gateway_name
Description: The name of the gateway
dx_private_hosted_vif_arn
Description: The ARN of the virtual interface
dx_private_hosted_vif_id
Description: The ID of the virtual interface.
dx_private_vif_arn
Description: The ARN of the public virtual interface.
dx_private_vif_id
Description: The ID of the public virtual interface.
dx_public_vif_arn
Description: The ARN of the public virtual interface.
dx_public_vif_id
Description: The ID of the public virtual interface.
vgw_id
Description: The ID of the VPN Gateway