diff --git a/provider.tf b/provider.tf index 405e262..2a514f4 100644 --- a/provider.tf +++ b/provider.tf @@ -12,3 +12,9 @@ terraform { } required_version = ">= 1.7.5" } +provider "vault" { + address = var.vault_url + skip_child_token = true + skip_tls_verify = true + token = var.vault_token +} \ No newline at end of file diff --git a/user.tf b/user.tf index 927e70d..d2b0af5 100644 --- a/user.tf +++ b/user.tf @@ -7,7 +7,7 @@ locals { } resource "random_password" "user_password" { - length = 12 + length = 20 } resource "google_sql_user" "user" { diff --git a/variables.tf b/variables.tf index 459f0ce..b3e38fb 100644 --- a/variables.tf +++ b/variables.tf @@ -2,6 +2,7 @@ variable "instance_name" { description = "the name of the database instance to create" type = string sensitive = true + default = "demo" } variable "region" { @@ -30,4 +31,18 @@ variable "database_user_name" { type = string sensitive = true default = "administrator" -} \ No newline at end of file +} + +variable "vault_url" { + description = "URL du serveur Vault" + type = string + sensitive = true + default = "https://vault.tips-of-mine.com" +} + +variable "vault_token" { + description = "Token d'acces" + type = string + sensitive = true + default = "hvs.BUXBydP1Iy6leqNIo2wx478p" +}