From 15fba2a9d87d32786c0b0fb82382a80ee7562873 Mon Sep 17 00:00:00 2001 From: robertsweetman Date: Wed, 3 Apr 2024 13:44:27 +0100 Subject: [PATCH] add asgs to temp and change default tags --- .../locals_defaults.tf | 6 ++- .../locals_development.tf | 13 ++++- .../oasys-national-reporting/locals_test.tf | 48 +++++++++++++++++++ 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/terraform/environments/oasys-national-reporting/locals_defaults.tf b/terraform/environments/oasys-national-reporting/locals_defaults.tf index e430d66f8c7..59b421d2e97 100644 --- a/terraform/environments/oasys-national-reporting/locals_defaults.tf +++ b/terraform/environments/oasys-national-reporting/locals_defaults.tf @@ -44,8 +44,10 @@ locals { vpc_security_group_ids = ["web"] }) tags = { - os-type = "Linux" - component = "onr_web" + ami = "base_rhel_7_9" + os-type = "Linux" + component = "web" + server-type = "onr-web" } # FIXME: ebs_volumes list is NOT YET CORRECT and will need to change ebs_volumes = { diff --git a/terraform/environments/oasys-national-reporting/locals_development.tf b/terraform/environments/oasys-national-reporting/locals_development.tf index 97c5d6405a2..270abdd186c 100644 --- a/terraform/environments/oasys-national-reporting/locals_development.tf +++ b/terraform/environments/oasys-national-reporting/locals_development.tf @@ -27,7 +27,6 @@ locals { # }) # }) # }) - # } # dev-bods-a = merge(local.defaults_bods_ec2, # { # config = merge(local.defaults_bods_ec2.config, { @@ -74,6 +73,18 @@ locals { }) autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours }) + dev-bods-asg = merge(local.defaults_bods_ec2, { + config = merge(local.defaults_bods_ec2.config,{ + availability_zone = "${local.region}a" + }) + instance = merge(local.defaults_bods_ec2.instance, { + instance_type = "t3.large" + }) + autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { + desired_capacity = 0 + }) + autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + }) } } } diff --git a/terraform/environments/oasys-national-reporting/locals_test.tf b/terraform/environments/oasys-national-reporting/locals_test.tf index f08d4400e22..445fe4cb0c8 100644 --- a/terraform/environments/oasys-national-reporting/locals_test.tf +++ b/terraform/environments/oasys-national-reporting/locals_test.tf @@ -2,5 +2,53 @@ locals { # baseline config test_config = { + baseline_ec2_autoscaling_groups = { + test-web-asg = merge(local.defaults_web_ec2.config, { + config = merge(local.defaults_web_ec2.config, { + availability_zone = "${local.region}a" + }) + instance = merge(local.defaults_web_ec2.instance, { + instance_type = "t3.large" + }) + user_data_cloud_init = merge(module.baseline_presets.ec2_instance.user_data_cloud_init.ssm_agent_and_ansible, { + args = merge(module.baseline_presets.ec2_instance.user_data_cloud_init.ssm_agent_and_ansible.args, { + branch = "main" + }) + }) + autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { + desired_capacity = 0 + }) + autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + }) + test-boe-asg = merge(local.defaults_boe_ec2, { + config = merge(local.defaults_boe_ec2.config, { + availability_zone = "${local.region}a" + }) + instance = merge(local.defaults_boe_ec2.instance, { + instance_type = "t2.large" + }) + user_data_cloud_init = merge(module.baseline_presets.ec2_instance.user_data_cloud_init.ssm_agent_and_ansible, { + args = merge(module.baseline_presets.ec2_instance.user_data_cloud_init.ssm_agent_and_ansible.args, { + branch = "main" + }) + }) + autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { + desired_capacity = 0 + }) + autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + }) + test-bods-asg = merge(local.defaults_bods_ec2, { + config = merge(local.defaults_bods_ec2.config,{ + availability_zone = "${local.region}a" + }) + instance = merge(local.defaults_bods_ec2.instance, { + instance_type = "t3.large" + }) + autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { + desired_capacity = 0 + }) + autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + }) + } } }