Skip to content

Commit

Permalink
Merge pull request #5602 from ministryofjustice/date_2024_04_08
Browse files Browse the repository at this point in the history
GitHub Actions Code Formatter workflow
  • Loading branch information
dms1981 authored Apr 8, 2024
2 parents ee34edb + 5b03f79 commit bb26393
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 82 deletions.
6 changes: 3 additions & 3 deletions terraform/environments/corporate-staff-rostering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"
]
]
}
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-jitbit/ses.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/*",
]
}]
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" = {
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/oas/modules/rds/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"all-environments": {},
"development": {},
"test": {},
"preproduction": {},
"production": {}
"all-environments": {},
"development": {},
"test": {},
"preproduction": {},
"production": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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"
Expand All @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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, {
Expand Down
6 changes: 3 additions & 3 deletions terraform/environments/planetfm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit bb26393

Please sign in to comment.