Skip to content

Commit

Permalink
v1.1.4: add custom_preshared_keys to vpn module
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 9, 2021
1 parent af0a964 commit 4794a5a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@
* v1.1.3 -- 20210708
- subnets
- add per-subnet tags

* v1.1.4 -- 20210709
- vpn
- add custom_preshared_keys
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "1.1.3"
_module_version = "1.1.4"
}
1 change: 1 addition & 0 deletions vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_account_alias"></a> [account\_alias](#input\_account\_alias) | AWS Account Alias | `string` | `""` | no |
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | AWS Account ID (default will pull from current user) | `string` | `""` | no |
| <a name="input_custom_preshared_keys"></a> [custom\_preshared\_keys](#input\_custom\_preshared\_keys) | List of one or two pre-shared keys to use for the two tunnels. If only one provided, it will use it for both tunnels. If missing, pre-shared keys will be generated. | `list(string)` | `[]` | no |
| <a name="input_override_prefixes"></a> [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no |
| <a name="input_route_table_ids"></a> [route\_table\_ids](#input\_route\_table\_ids) | List of created route table IDs for privating routing to be used for VPN route propagation | `list(string)` | `[]` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no |
Expand Down
4 changes: 2 additions & 2 deletions vpn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ resource "aws_vpn_connection" "vpn" {
type = "ipsec.1"
vpn_gateway_id = aws_vpn_gateway.vpn.id
customer_gateway_id = aws_customer_gateway.vpn[each.key].id
tunnel1_preshared_key = random_string.tunnel_preshared_key[each.key].result
tunnel2_preshared_key = random_string.tunnel_preshared_key[each.key].result
tunnel1_preshared_key = length(var.custom_preshared_keys) == 0 ? random_string.tunnel_preshared_key[each.key].result : element(var.custom_preshared_keys, 0)
tunnel2_preshared_key = length(var.custom_preshared_keys) == 0 ? random_string.tunnel_preshared_key[each.key].result : element(var.custom_preshared_keys, 1)
# static_routes_only = var.vpc_vpn_dynamic_routing ? false : true
static_routes_only = false

Expand Down
6 changes: 6 additions & 0 deletions vpn/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ variable "route_table_ids" {
default = []
}


variable "custom_preshared_keys" {
description = "List of one or two pre-shared keys to use for the two tunnels. If only one provided, it will use it for both tunnels. If missing, pre-shared keys will be generated."
type = list(string)
default = []
}

0 comments on commit 4794a5a

Please sign in to comment.