From 9c6cf3e0f940d25ae1afe7b1d0a4e37546c770bf Mon Sep 17 00:00:00 2001 From: robertsweetman Date: Thu, 18 Apr 2024 18:06:30 +0100 Subject: [PATCH] add test secretsmanager secrets --- terraform/environments/oasys-national-reporting/locals.tf | 1 + .../oasys-national-reporting/locals_defaults.tf | 6 ++++++ .../environments/oasys-national-reporting/locals_test.tf | 7 +++++++ terraform/environments/oasys-national-reporting/main.tf | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/terraform/environments/oasys-national-reporting/locals.tf b/terraform/environments/oasys-national-reporting/locals.tf index 8742830b9ed..494c6814ba4 100644 --- a/terraform/environments/oasys-national-reporting/locals.tf +++ b/terraform/environments/oasys-national-reporting/locals.tf @@ -84,4 +84,5 @@ locals { baseline_sns_topics = {} baseline_ssm_parameters = {} + baseline_secretsmanager_secrets = {} } diff --git a/terraform/environments/oasys-national-reporting/locals_defaults.tf b/terraform/environments/oasys-national-reporting/locals_defaults.tf index 96ffa09a745..71100d44a61 100644 --- a/terraform/environments/oasys-national-reporting/locals_defaults.tf +++ b/terraform/environments/oasys-national-reporting/locals_defaults.tf @@ -19,6 +19,12 @@ locals { ) } + database_secretsmanager_secrets = { + secrets = { + passwords = { description = "database passwords" } + } + } + defaults_ec2 = { config = merge(module.baseline_presets.ec2_instance.config.default, { ami_owner = "self" diff --git a/terraform/environments/oasys-national-reporting/locals_test.tf b/terraform/environments/oasys-national-reporting/locals_test.tf index ba76f22ad50..0d4d4d72713 100644 --- a/terraform/environments/oasys-national-reporting/locals_test.tf +++ b/terraform/environments/oasys-national-reporting/locals_test.tf @@ -2,6 +2,13 @@ locals { # baseline config test_config = { + + baseline_secretsmanager_secrets = { + "/oracle/database/T3ONRAU" = local.database_secretsmanager_secrets + "/oracle/database/T3ONRBDS" = local.database_secretsmanager_secrets + "/oracle/database/T3ONRSYS" = local.database_secretsmanager_secrets + } + # baseline_ec2_instances = { # test-db = merge(local.defaults_onr_db_ec2 ,{ # config = merge(local.defaults_onr_db_ec2.config, { diff --git a/terraform/environments/oasys-national-reporting/main.tf b/terraform/environments/oasys-national-reporting/main.tf index 18656984ae2..33d066afcd5 100644 --- a/terraform/environments/oasys-national-reporting/main.tf +++ b/terraform/environments/oasys-national-reporting/main.tf @@ -116,6 +116,11 @@ module "baseline" { lookup(local.baseline_environment_config, "baseline_s3_buckets", {}) ) + secretsmanager_secrets = merge( + local.baseline_secretsmanager_secrets, + lookup(local.baseline_environment_config, "baseline_secretsmanager_secrets", {}) + ) + security_groups = merge( local.baseline_security_groups, lookup(local.baseline_environment_config, "baseline_security_groups", {})