diff --git a/terraform/environments/corporate-staff-rostering/main.tf b/terraform/environments/corporate-staff-rostering/main.tf index b8528a2a5e4..54d8c1747bf 100644 --- a/terraform/environments/corporate-staff-rostering/main.tf +++ b/terraform/environments/corporate-staff-rostering/main.tf @@ -145,9 +145,9 @@ module "baseline" { } module "cross_account_cloudwatch" { - source = "../../modules/cross_account_cloudwatch" - environment = module.environment - options = merge( + source = "../../modules/cross_account_cloudwatch" + environment = module.environment + options = merge( local.cloudwatch_monitoring_options, local.cloudwatch_local_environment_monitoring_options, ) diff --git a/terraform/environments/delius-core/modules/components/oracle_db_shared/s3.tf b/terraform/environments/delius-core/modules/components/oracle_db_shared/s3.tf index ae5db7ba2b4..5ec6d36c5a9 100644 --- a/terraform/environments/delius-core/modules/components/oracle_db_shared/s3.tf +++ b/terraform/environments/delius-core/modules/components/oracle_db_shared/s3.tf @@ -143,7 +143,7 @@ data "aws_iam_policy_document" "oracledb_remote_backup_bucket_access" { resources = [ "arn:aws:s3:::${local.oracle_duplicate_delius_source_environment}-oracle-database-backups", "arn:aws:s3:::${local.oracle_duplicate_delius_source_environment}-oracle-database-backups/*" - ] + ] } } diff --git a/terraform/environments/delius-jitbit/ses.tf b/terraform/environments/delius-jitbit/ses.tf index bcc80d12c0e..5a54a8b16d1 100644 --- a/terraform/environments/delius-jitbit/ses.tf +++ b/terraform/environments/delius-jitbit/ses.tf @@ -3,11 +3,11 @@ #############" resource "aws_ses_domain_identity" "jitbit" { - domain = "${local.app_url}" + domain = local.app_url } resource "aws_ses_domain_identity_verification" "jitbit" { - domain = "${local.app_url}" + domain = local.app_url } resource "aws_route53_record" "jitbit_ses_verification_record" { diff --git a/terraform/environments/digital-prison-reporting/modules/compute_node/iam.tf b/terraform/environments/digital-prison-reporting/modules/compute_node/iam.tf index de6c913be48..b6b59556357 100644 --- a/terraform/environments/digital-prison-reporting/modules/compute_node/iam.tf +++ b/terraform/environments/digital-prison-reporting/modules/compute_node/iam.tf @@ -67,21 +67,21 @@ resource "aws_iam_role_policy_attachment" "this" { # Temporary policy to allow the operational DB to grab Oracle dependencies that aren't available on the public Internet resource "aws_iam_role_policy" "allow_s3_read" { - count = (var.enable_compute_node && var.app_key == "operational-db")? 1 : 0 - name = "S3TemporaryReadPolicy" - role = aws_iam_role.instance-role[0].name + count = (var.enable_compute_node && var.app_key == "operational-db") ? 1 : 0 + name = "S3TemporaryReadPolicy" + role = aws_iam_role.instance-role[0].name policy = jsonencode({ - "Version": "2012-10-17", - "Statement": [{ - "Action": [ - "s3:GetObject", - "s3:ListBucket", - ] - "Effect": "Allow", - "Resource": [ - "arn:aws:s3:::dpr-working-development", - "arn:aws:s3:::dpr-working-development/*", - ] + "Version" : "2012-10-17", + "Statement" : [{ + "Action" : [ + "s3:GetObject", + "s3:ListBucket", + ] + "Effect" : "Allow", + "Resource" : [ + "arn:aws:s3:::dpr-working-development", + "arn:aws:s3:::dpr-working-development/*", + ] }] }) } \ No newline at end of file diff --git a/terraform/environments/digital-prison-reporting/modules/compute_node/variables.tf b/terraform/environments/digital-prison-reporting/modules/compute_node/variables.tf index 71909dfc358..7e17a6f92d2 100644 --- a/terraform/environments/digital-prison-reporting/modules/compute_node/variables.tf +++ b/terraform/environments/digital-prison-reporting/modules/compute_node/variables.tf @@ -137,8 +137,8 @@ variable "account" { variable "scale_down" { description = "Whether to scale down the auto scaling groups in the evening to save costs" - type = bool - default = true + type = bool + default = true } #variable "s3_policy_arn" { diff --git a/terraform/environments/digital-prison-reporting/modules/ec2/main.tf b/terraform/environments/digital-prison-reporting/modules/ec2/main.tf index e1f32838fac..3855d0834d6 100644 --- a/terraform/environments/digital-prison-reporting/modules/ec2/main.tf +++ b/terraform/environments/digital-prison-reporting/modules/ec2/main.tf @@ -141,7 +141,7 @@ resource "aws_autoscaling_group" "bastion_linux_daily" { } resource "aws_autoscaling_schedule" "bastion_linux_scale_down" { - count = var.scale_down ? 1 : 0 + count = var.scale_down ? 1 : 0 scheduled_action_name = "${var.name}_scaledown" min_size = 0 max_size = 0 @@ -151,7 +151,7 @@ resource "aws_autoscaling_schedule" "bastion_linux_scale_down" { } resource "aws_autoscaling_schedule" "bastion_linux_scale_up" { - count = var.scale_down ? 1 : 0 + count = var.scale_down ? 1 : 0 scheduled_action_name = "${var.name}_scaleup" min_size = 1 max_size = 1 diff --git a/terraform/environments/digital-prison-reporting/modules/ec2/variables.tf b/terraform/environments/digital-prison-reporting/modules/ec2/variables.tf index f197084b207..470a9a10c7d 100644 --- a/terraform/environments/digital-prison-reporting/modules/ec2/variables.tf +++ b/terraform/environments/digital-prison-reporting/modules/ec2/variables.tf @@ -129,8 +129,8 @@ variable "account" { variable "scale_down" { description = "Whether to scale down the auto scaling groups in the evening to save costs" - type = bool - default = true + type = bool + default = true } #variable "s3_policy_arn" { diff --git a/terraform/environments/digital-prison-reporting/operational_db.tf b/terraform/environments/digital-prison-reporting/operational_db.tf index 947f3a68894..de0f3f85d33 100644 --- a/terraform/environments/digital-prison-reporting/operational_db.tf +++ b/terraform/environments/digital-prison-reporting/operational_db.tf @@ -19,16 +19,16 @@ module "operational_db_server" { ebs_size = 300 ebs_encrypted = true ebs_delete_on_termination = false - policies = [ + policies = [ "arn:aws:iam::${local.account_id}:policy/${local.s3_read_access_policy}", "arn:aws:iam::${local.account_id}:policy/${local.kms_read_access_policy}", "arn:aws:iam::${local.account_id}:policy/${local.apigateway_get_policy}", ] - region = local.account_region - account = local.account_id - env = local.env - app_key = "operational-db" + region = local.account_region + account = local.account_id + env = local.env + app_key = "operational-db" ec2_sec_rules = { # Allow access to Postgres only from our subnet "TCP_5432" = { @@ -44,8 +44,8 @@ module "operational_db_server" { } env_vars = { - POSTGRES_P = "postgres" # WEAK - this is just used for dev environment only spike - ENV = local.env + POSTGRES_P = "postgres" # WEAK - this is just used for dev environment only spike + ENV = local.env } tags = merge( diff --git a/terraform/environments/oas/modules/rds/rds.tf b/terraform/environments/oas/modules/rds/rds.tf index 0867489b69d..10c8e9d2959 100644 --- a/terraform/environments/oas/modules/rds/rds.tf +++ b/terraform/environments/oas/modules/rds/rds.tf @@ -125,7 +125,7 @@ resource "aws_db_instance" "appdb1" { storage_encrypted = true apply_immediately = true # snapshot_identifier = var.rds_snapshot_arn - kms_key_id = var.rds_kms_key_arn + kms_key_id = var.rds_kms_key_arn tags = merge( var.tags, { "Name" = "${var.application_name}-${var.environment}-database" }, diff --git a/terraform/environments/oasys-national-reporting/.ssh/user-keys.json b/terraform/environments/oasys-national-reporting/.ssh/user-keys.json index f968c8d8d3a..720a9806965 100644 --- a/terraform/environments/oasys-national-reporting/.ssh/user-keys.json +++ b/terraform/environments/oasys-national-reporting/.ssh/user-keys.json @@ -1,7 +1,7 @@ { - "all-environments": {}, - "development": {}, - "test": {}, - "preproduction": {}, - "production": {} + "all-environments": {}, + "development": {}, + "test": {}, + "preproduction": {}, + "production": {} } diff --git a/terraform/environments/oasys-national-reporting/locals_defaults.tf b/terraform/environments/oasys-national-reporting/locals_defaults.tf index 9ab3db81087..8d4564cd79b 100644 --- a/terraform/environments/oasys-national-reporting/locals_defaults.tf +++ b/terraform/environments/oasys-national-reporting/locals_defaults.tf @@ -62,7 +62,7 @@ locals { ami_name = "base_rhel_6_10_*" }) instance = merge(local.defaults_ec2.instance, { - vpc_security_group_ids = ["boe", "oasys_db"] + vpc_security_group_ids = ["boe", "oasys_db"] metadata_options_http_tokens = "optional" # required as Rhel 6 cloud-init does not support IMDSv2 }) # cloudwatch_metric_alarms = local.ec2_cloudwatch_metric_alarms.boe off for now diff --git a/terraform/environments/oasys-national-reporting/locals_development.tf b/terraform/environments/oasys-national-reporting/locals_development.tf index 270abdd186c..e889315622b 100644 --- a/terraform/environments/oasys-national-reporting/locals_development.tf +++ b/terraform/environments/oasys-national-reporting/locals_development.tf @@ -4,38 +4,38 @@ locals { development_config = { baseline_ec2_instances = { - # dev-web-a = merge(local.defaults_web_ec2, - # { - # config = merge(local.defaults_web_ec2.config, { - # availability_zone = "${local.region}a" - # }) - # instance = merge(local.defaults_web_ec2.instance, { - # instance_type = "t3.large" - # }) - # }) - # dev-boe-a = 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" - # }) - # }) - # }) - # dev-bods-a = 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" - # }) - # }) + # dev-web-a = merge(local.defaults_web_ec2, + # { + # config = merge(local.defaults_web_ec2.config, { + # availability_zone = "${local.region}a" + # }) + # instance = merge(local.defaults_web_ec2.instance, { + # instance_type = "t3.large" + # }) + # }) + # dev-boe-a = 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" + # }) + # }) + # }) + # dev-bods-a = 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" + # }) + # }) } baseline_ec2_autoscaling_groups = { @@ -58,7 +58,7 @@ locals { }) dev-boe-asg = merge(local.defaults_boe_ec2, { config = merge(local.defaults_boe_ec2.config, { - availability_zone = "${local.region}a" + availability_zone = "${local.region}a" }) instance = merge(local.defaults_boe_ec2.instance, { instance_type = "t2.large" @@ -71,10 +71,10 @@ locals { autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { desired_capacity = 0 }) - autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + 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,{ + config = merge(local.defaults_bods_ec2.config, { availability_zone = "${local.region}a" }) instance = merge(local.defaults_bods_ec2.instance, { diff --git a/terraform/environments/oasys-national-reporting/locals_test.tf b/terraform/environments/oasys-national-reporting/locals_test.tf index 1d190146e8a..19e2f931625 100644 --- a/terraform/environments/oasys-national-reporting/locals_test.tf +++ b/terraform/environments/oasys-national-reporting/locals_test.tf @@ -2,7 +2,7 @@ locals { # baseline config test_config = { - baseline_ec2_autoscaling_groups = { + 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" @@ -22,7 +22,7 @@ locals { }) test-boe-asg = merge(local.defaults_boe_ec2, { config = merge(local.defaults_boe_ec2.config, { - availability_zone = "${local.region}a" + availability_zone = "${local.region}a" }) instance = merge(local.defaults_boe_ec2.instance, { instance_type = "t2.large" @@ -35,10 +35,10 @@ locals { autoscaling_group = merge(module.baseline_presets.ec2_autoscaling_group.default, { desired_capacity = 0 }) - autoscaling_schedules = module.baseline_presets.ec2_autoscaling_schedules.working_hours + 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,{ + config = merge(local.defaults_bods_ec2.config, { availability_zone = "${local.region}a" }) instance = merge(local.defaults_bods_ec2.instance, { diff --git a/terraform/environments/planetfm/main.tf b/terraform/environments/planetfm/main.tf index ca56e1134da..ab37210b89b 100644 --- a/terraform/environments/planetfm/main.tf +++ b/terraform/environments/planetfm/main.tf @@ -139,9 +139,9 @@ module "baseline" { } module "cross_account_cloudwatch" { - source = "../../modules/cross_account_cloudwatch" - environment = module.environment - options = merge( + source = "../../modules/cross_account_cloudwatch" + environment = module.environment + options = merge( local.cloudwatch_monitoring_options, local.cloudwatch_local_environment_monitoring_options, )