-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove obsolete variables * Fix examples
- Loading branch information
Showing
13 changed files
with
140 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
# The Transit Gateway (hub) has already been created in AWS, as a fixture for | ||
# this test case due to not being able to use 'depends_on' on Terraform modules | ||
module "vpn" { | ||
source = "../../" | ||
module "tgw" { | ||
source = "github.com/flaconi/terraform-aws-transit-gateway-hub.git?ref=v1.6.0" | ||
|
||
providers = { aws = aws } | ||
name = var.transit_gateway_hub_name | ||
|
||
role_to_assume = var.role_to_assume | ||
allowed_account_id = var.allowed_account_id | ||
aws_account_id_hub = var.allowed_account_id | ||
aws_account_id_satellite = [var.transit_gateway_satellite_account_id] | ||
} | ||
|
||
module "vpn" { | ||
source = "../../" | ||
|
||
name = var.name | ||
|
||
cgw_bgp_asn = var.cgw_bgp_asn | ||
cgw_ip_address = var.cgw_ip_address | ||
|
||
transit_gateway_hub_name = var.transit_gateway_hub_name | ||
static_routes_only = var.static_routes_only | ||
static_routes_destinations = var.static_routes_destinations | ||
transit_gateway_hub_name = var.transit_gateway_hub_name | ||
transit_gateway_hub_account_id = var.allowed_account_id | ||
static_routes_only = var.static_routes_only | ||
static_routes_destinations = var.static_routes_destinations | ||
|
||
tunnel1_inside_cidr = var.tunnel1_inside_cidr | ||
tunnel2_inside_cidr = var.tunnel2_inside_cidr | ||
tunnel1_preshared_key = var.tunnel1_preshared_key | ||
tunnel2_preshared_key = var.tunnel2_preshared_key | ||
|
||
tags = var.tags | ||
|
||
depends_on = [module.tgw] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
variable "allowed_account_id" { | ||
description = "AWS account ID for which this module can be executed" | ||
type = string | ||
} | ||
|
||
variable "role_to_assume" { | ||
description = "IAM role name to assume (eg. ASSUME-ROLE-HUB)" | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "name" { | ||
description = "Generic name to be given to the provisioned resources" | ||
type = string | ||
} | ||
variable "tags" { | ||
description = "Map of custom tags for the provisioned resources" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "cgw_bgp_asn" { | ||
description = "The gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN)." | ||
type = string | ||
} | ||
|
||
variable "cgw_ip_address" { | ||
description = "IP address of the client VPN endpoint" | ||
type = string | ||
} | ||
|
||
variable "transit_gateway_hub_name" { | ||
description = "Name of the Transit Gateway to attach the VPN to" | ||
type = string | ||
} | ||
|
||
variable "transit_gateway_satellite_account_id" { | ||
description = "AWS account ID for which the module should share TGW resource" | ||
type = string | ||
} | ||
|
||
variable "static_routes_only" { | ||
description = "Whether the VPN connection uses static routes exclusively. Static routes must be used for devices that don't support BGP" | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "static_routes_destinations" { | ||
description = "List of CIDRs to be routed into the VPN tunnel." | ||
type = list(string) | ||
default = [] | ||
} | ||
|
||
# https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_VpnTunnelOptionsSpecification.html | ||
variable "tunnel1_inside_cidr" { | ||
description = "A size /30 CIDR block from the 169.254.0.0/16 range" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "tunnel2_inside_cidr" { | ||
description = "A size /30 CIDR block from the 169.254.0.0/16 range" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "tunnel1_preshared_key" { | ||
description = "Will be stored in the state as plaintext. Must be between 8 & 64 chars and can't start with zero(0). Allowed characters are alphanumeric, periods(.) and underscores(_)" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "tunnel2_preshared_key" { | ||
description = "Will be stored in the state as plaintext. Must be between 8 & 64 chars and can't start with zero(0). Allowed characters are alphanumeric, periods(.) and underscores(_)" | ||
type = string | ||
default = null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5" | ||
} | ||
} | ||
required_version = ">= 1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters