170237669 - Converts postgres secrets to use keyvault
This changes the configuration of the postgres master username and password. Instead of committing to source (short term hack), this now sources those secrets from KeyVault. Those secrets are generated and populated via secrets-tool.
This commit is contained in:
parent
a4f2881a61
commit
9c429e35da
@ -75,13 +75,11 @@ variable "storage_auto_grow" {
|
|||||||
variable "administrator_login" {
|
variable "administrator_login" {
|
||||||
type = string
|
type = string
|
||||||
description = "Administrator login"
|
description = "Administrator login"
|
||||||
default = "atat_master" # FIXME - Remove with wrapper using KeyVault
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "administrator_login_password" {
|
variable "administrator_login_password" {
|
||||||
type = string
|
type = string
|
||||||
description = "Administrator password"
|
description = "Administrator password"
|
||||||
default = "eI0l7yswwtuhHpwzoVjwRKdAcuGNsg" # FIXME - Remove with wrapper using KeyVault
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "postgres_version" {
|
variable "postgres_version" {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
data "azurerm_key_vault_secret" "postgres_username" {
|
||||||
|
name = "postgres-root-user"
|
||||||
|
key_vault_id = module.operator_keyvault.id
|
||||||
|
}
|
||||||
|
|
||||||
|
data "azurerm_key_vault_secret" "postgres_password" {
|
||||||
|
name = "postgres-root-password"
|
||||||
|
key_vault_id = module.operator_keyvault.id
|
||||||
|
}
|
||||||
|
|
||||||
module "sql" {
|
module "sql" {
|
||||||
source = "../../modules/postgres"
|
source = "../../modules/postgres"
|
||||||
name = var.name
|
name = var.name
|
||||||
@ -5,4 +15,6 @@ module "sql" {
|
|||||||
environment = var.environment
|
environment = var.environment
|
||||||
region = var.region
|
region = var.region
|
||||||
subnet_id = module.vpc.subnets # FIXME - Should be a map of subnets and specify private
|
subnet_id = module.vpc.subnets # FIXME - Should be a map of subnets and specify private
|
||||||
|
administrator_login = data.azurerm_key_vault_secret.postgres_username.value
|
||||||
|
administrator_login_password = data.azurerm_key_vault_secret.postgres_password.value
|
||||||
}
|
}
|
||||||
|
10
terraform/providers/dev/secrets.tf
Normal file
10
terraform/providers/dev/secrets.tf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module "operator_keyvault" {
|
||||||
|
source = "../../modules/keyvault"
|
||||||
|
name = "operator"
|
||||||
|
region = var.region
|
||||||
|
owner = var.owner
|
||||||
|
environment = var.environment
|
||||||
|
tenant_id = var.tenant_id
|
||||||
|
principal_id = ""
|
||||||
|
admin_principals = var.admin_users
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user