Skip to content

Instantly share code, notes, and snippets.

@paultyng
Last active November 30, 2017 22:52
Show Gist options
  • Save paultyng/23527290e4f455f11aa2c0d88bc11936 to your computer and use it in GitHub Desktop.
Save paultyng/23527290e4f455f11aa2c0d88bc11936 to your computer and use it in GitHub Desktop.
Terraform Random Password Module
variable "length" {
default = "20"
}
resource "random_id" "password" {
byte_length = "${var.length * 3 / 4}"
}
output "password" {
value = "${random_id.password.b64}"
}
module "password" {
source = "../"
length = "20"
}
output "password" { value = "${module.password.password}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment