Skip to content

Commit

Permalink
CAXDR-13: Make PSK generation configurable (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukiffer committed Jun 30, 2022
1 parent 80e9636 commit 4cfc22b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/azure-virtual-network-gateway-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ resource "azurerm_local_network_gateway" "remote" {

resource "random_password" "psk" {
length = 32
special = true
upper = true
lower = true
number = true
special = var.psk_use_special_characters
upper = var.psk_use_upper_alpha
lower = var.psk_use_lower_alpha
number = var.psk_use_numbers
}

resource "azurerm_virtual_network_gateway_connection" "connection" {
Expand Down
24 changes: 24 additions & 0 deletions modules/azure-virtual-network-gateway-connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ variable "connection_protocol" {
default = "IKEv2"
}

variable "psk_use_special_characters" {
description = "Whether or not the generated PSK should include special characters."
type = bool
default = true
}

variable "psk_use_upper_alpha" {
description = "Whether or not the generated PSK should include uppercase alpha characters."
type = bool
default = true
}

variable "psk_use_lower_alpha" {
description = "Whether or not the generated PSK should include lowercase alpha characters."
type = bool
default = true
}

variable "psk_use_numbers" {
description = "Whether or not the generated PSK should include numbers."
type = bool
default = true
}

variable "tags" {
description = "A set of tags applied to this resource."
type = map(string)
Expand Down

0 comments on commit 4cfc22b

Please sign in to comment.