Skip to content

Instantly share code, notes, and snippets.

@jungopro
Created October 5, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jungopro/4c827e4a1f877bd8183b0de3cd0cac2c to your computer and use it in GitHub Desktop.
Save jungopro/4c827e4a1f877bd8183b0de3cd0cac2c to your computer and use it in GitHub Desktop.
resource "random_string" "password" {
length = 14
min_upper = 2
min_lower = 2
min_numeric = 2
min_special = 2
}
resource "azurerm_key_vault_secret" "secret" {
name = "${var.secret_name}"
value = "${random_string.password.result}"
vault_uri = "${var.vault_uri}"
tags {
environment = "${var.resource_group_name}"
}
}
output "password_result" {
value = "${random_string.password.result}"
}
output "secrets" {
value = ["${azurerm_key_vault_secret.secret.*.value}"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment