Last active
November 30, 2017 22:52
-
-
Save paultyng/23527290e4f455f11aa2c0d88bc11936 to your computer and use it in GitHub Desktop.
Terraform Random Password Module
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
variable "length" { | |
default = "20" | |
} | |
resource "random_id" "password" { | |
byte_length = "${var.length * 3 / 4}" | |
} | |
output "password" { | |
value = "${random_id.password.b64}" | |
} |
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
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