Skip to content

Instantly share code, notes, and snippets.

@asalimonov
Created July 8, 2020 17:14
Show Gist options
  • Save asalimonov/fea3c343977996bf7479f1dcb4dbd68d to your computer and use it in GitHub Desktop.
Save asalimonov/fea3c343977996bf7479f1dcb4dbd68d to your computer and use it in GitHub Desktop.
Terraform random passwords
provider "random" {
version = "2.2.0"
}
variable "users" {
type = set(string)
default = ["alice", "bob"]
}
resource "random_password" "pwd" {
for_each = var.users
length = 16
special = true
override_special = "_%@"
}
output "accs" {
value = random_password.pwd.*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment