Skip to content

Commit

Permalink
Merge pull request #8221 from ministryofjustice/date_2024_10_14
Browse files Browse the repository at this point in the history
GitHub Actions Code Formatter workflow
  • Loading branch information
ASTRobinson authored Oct 14, 2024
2 parents 784d9ca + 328150a commit b614039
Show file tree
Hide file tree
Showing 34 changed files with 470 additions and 470 deletions.
4 changes: 2 additions & 2 deletions terraform/environments/apex/cloudfront.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
locals {
lower_env_cloudfront_url = "${local.application_name}.${data.aws_route53_zone.external.name}"
# TODO: The production CloudFront FQDN is to be determined
prod_fqdn = data.aws_route53_zone.production_network_services.name
cloudfront_alias = local.environment == "production" ? local.prod_fqdn : local.lower_env_cloudfront_url
prod_fqdn = data.aws_route53_zone.production_network_services.name
cloudfront_alias = local.environment == "production" ? local.prod_fqdn : local.lower_env_cloudfront_url
cloudfront_domain = local.environment == "production" ? data.aws_route53_zone.production_network_services.name : local.application_data.accounts[local.environment].acm_cert_domain_name

custom_header = "X-Custom-Header-LAA-${upper(local.application_name)}"
Expand Down
30 changes: 15 additions & 15 deletions terraform/environments/apex/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ module "apex-ecs" {
ec2_min_size = local.application_data.accounts[local.environment].ec2_min_size
# task_definition_volume = local.application_data.accounts[local.environment].task_definition_volume
# network_mode = local.application_data.accounts[local.environment].network_mode
server_port = local.application_data.accounts[local.environment].server_port
app_count = local.application_data.accounts[local.environment].app_count
ec2_ingress_rules = local.ec2_ingress_rules
ec2_egress_rules = local.ec2_egress_rules
lb_tg_arn = module.alb.target_group_arn
tags_common = local.tags
appscaling_min_capacity = local.application_data.accounts[local.environment].appscaling_min_capacity
appscaling_max_capacity = local.application_data.accounts[local.environment].appscaling_max_capacity
ecs_scaling_cpu_threshold = local.application_data.accounts[local.environment].ecs_scaling_cpu_threshold
ecs_scaling_mem_threshold = local.application_data.accounts[local.environment].ecs_scaling_mem_threshold
ecs_target_capacity = local.ecs_target_capacity
ec2_instance_warmup_period = local.application_data.accounts[local.environment].ec2_instance_warmup_period
log_group_kms_key = aws_kms_key.cloudwatch_logs_key.arn
environment = local.environment
database_tad_password_arn = "arn:aws:ssm:${local.application_data.accounts[local.environment].region}:${local.env_account_id}:parameter/${local.app_db_password_name}"
server_port = local.application_data.accounts[local.environment].server_port
app_count = local.application_data.accounts[local.environment].app_count
ec2_ingress_rules = local.ec2_ingress_rules
ec2_egress_rules = local.ec2_egress_rules
lb_tg_arn = module.alb.target_group_arn
tags_common = local.tags
appscaling_min_capacity = local.application_data.accounts[local.environment].appscaling_min_capacity
appscaling_max_capacity = local.application_data.accounts[local.environment].appscaling_max_capacity
ecs_scaling_cpu_threshold = local.application_data.accounts[local.environment].ecs_scaling_cpu_threshold
ecs_scaling_mem_threshold = local.application_data.accounts[local.environment].ecs_scaling_mem_threshold
ecs_target_capacity = local.ecs_target_capacity
ec2_instance_warmup_period = local.application_data.accounts[local.environment].ec2_instance_warmup_period
log_group_kms_key = aws_kms_key.cloudwatch_logs_key.arn
environment = local.environment
database_tad_password_arn = "arn:aws:ssm:${local.application_data.accounts[local.environment].region}:${local.env_account_id}:parameter/${local.app_db_password_name}"

}
6 changes: 3 additions & 3 deletions terraform/environments/ccms-ebs/ccms-lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ resource "aws_lambda_function" "lambda_function" {
}
}
logging_config {
log_format = "JSON"
application_log_level = "INFO"
system_log_level = "INFO"
log_format = "JSON"
application_log_level = "INFO"
system_log_level = "INFO"
}

tags = merge(local.tags, {
Expand Down
18 changes: 9 additions & 9 deletions terraform/environments/corporate-information-system/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ data "local_file" "userdata" {
######################################

resource "aws_instance" "cis_db_instance" {
ami = local.application_data.accounts[local.environment].app_ami_id
instance_type = local.application_data.accounts[local.environment].ec2instancetype
key_name = aws_key_pair.cis.key_name
ebs_optimized = true
subnet_id = data.aws_subnet.data_subnets_a.id
iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile.name
vpc_security_group_ids = [aws_security_group.ec2_instance_sg.id]
ami = local.application_data.accounts[local.environment].app_ami_id
instance_type = local.application_data.accounts[local.environment].ec2instancetype
key_name = aws_key_pair.cis.key_name
ebs_optimized = true
subnet_id = data.aws_subnet.data_subnets_a.id
iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile.name
vpc_security_group_ids = [aws_security_group.ec2_instance_sg.id]
user_data_replace_on_change = true
user_data = base64encode(data.local_file.userdata.content)

root_block_device {
delete_on_termination = false
encrypted = true
encrypted = true
volume_size = 200
volume_type = "gp2"
tags = merge(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"keys": {
"development": {
"vladimir": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOnw4QKOmTzWVoxfRYY6ZUdoFxJxZ0k1xB9n6aKuPDOa vladimirs.kovalovs@L0854",
"peterlaw": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrv2NfUClQgRCJeUz5063InOJNcOeOIHB77bulXjYV0czkM/TpeRSYKZM5Wta4nUdXiI5jFCNPBIMe1WLoDPfQ7fVlOrHovbwlWN03WlKjEOdL3AiTV/i4QN0BgP9NJUghvrrkkazoNHi8+TZFSBAcL4vPYlVG9ZruvAuhj/211n304cRffh6v7FwET+0ntEXFzZIsRQZ9kdCUX3lFgDZKKup6HdHW83TUbnJtqcuClq64JtaePkaUGL4vgleMYwpy2xsJ7GTq0o8dCKfHxcU5o7hGsv0PrQbOdyRYgfNt0JQxarB1PsXxKSeSi9p3to6N3o9t+CdttExVLPUnbt54nqtLCWaTcZUMBLMJIqkOlYcYgnhWDWG1i6AeYmZPaYoY+YjUX6fFoIpaA4qlyiMOXI+ZhSUg4EKU9ad5VkAfZAhDzoQXP2UyBNz8ZKDRLdnUJKovgOMUmiyF5vARQs5U1q7wcf4nbjoLv/g0GLRgdsfrCKrccB2pwtlrFEYI9LE= peterlaw@L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k61kVbLhOFaxv2RFArYl3K96VMfn8EcYCuk0Fts3HTYoVActGPoRFjU= alan.maydwell@MJ003801"
},
"preproduction": {},
"production": {}
}
}
"keys": {
"development": {
"vladimir": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOnw4QKOmTzWVoxfRYY6ZUdoFxJxZ0k1xB9n6aKuPDOa vladimirs.kovalovs@L0854",
"peterlaw": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrv2NfUClQgRCJeUz5063InOJNcOeOIHB77bulXjYV0czkM/TpeRSYKZM5Wta4nUdXiI5jFCNPBIMe1WLoDPfQ7fVlOrHovbwlWN03WlKjEOdL3AiTV/i4QN0BgP9NJUghvrrkkazoNHi8+TZFSBAcL4vPYlVG9ZruvAuhj/211n304cRffh6v7FwET+0ntEXFzZIsRQZ9kdCUX3lFgDZKKup6HdHW83TUbnJtqcuClq64JtaePkaUGL4vgleMYwpy2xsJ7GTq0o8dCKfHxcU5o7hGsv0PrQbOdyRYgfNt0JQxarB1PsXxKSeSi9p3to6N3o9t+CdttExVLPUnbt54nqtLCWaTcZUMBLMJIqkOlYcYgnhWDWG1i6AeYmZPaYoY+YjUX6fFoIpaA4qlyiMOXI+ZhSUg4EKU9ad5VkAfZAhDzoQXP2UyBNz8ZKDRLdnUJKovgOMUmiyF5vARQs5U1q7wcf4nbjoLv/g0GLRgdsfrCKrccB2pwtlrFEYI9LE= peterlaw@L0650",
"hellema.ibrahim": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCYnLUnbagGE101sXq0WJh8UgsoqcZRgnoB5XgXedo3wjvTtF/jNarbHvfMRCPukgjb5UyTbDsWt9VAww+SaXdudalH0Ql6ESJbvrQfeq7ImxS900D6yOCRTgXfHrPm1Tk/Dd+/eue9FKLBnjErQlite+M144BhAZZw1D+9j47dzlxVtbExA4Zg6wTdyRokSHsmtwgei4KoRhTC3Wz+GeHgDelYf3/JpESXWKrdqatYVgymYMFGqYYdNYm49wXuN7+w1hPGRBnEAktoxbUsyLr9hfPcUx8Qxk1oK5KVEAPd2Y+PaaEQzfKVKPsIibBUxowsbocll2Gn3xaW2hs9savAtupF+UwZX+KRWntYuZvv2x9tvzcdl+vrFJiv+QG5aWqIBa679dHsUXkYeBiPw9Dzi6kufn9VDV9Qp3zdd1geU748gFvYNtT8J2zLh5jfVNjIC3FkK0A4Jv+i3duLjxjAqnlWKJVuk7L30BiNAccUkHINSK7xYuTjgbY3e+99Lk= hellema.ibrahim@MJ003632",
"alan.maydwell": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDBcS2Ufmn0R91Gmk6MrGIczqTPrv1c5IXzSKeq4roAZNRUcb0BwSZQzTabv9LWcXd8pljXcOF4jkjPGJUfwrE23oBTqhDh9bU/EZIsAqED0o2QCtDxuW9nJbSwDvn3cMw/M5XzCRtjCnlHr8oWrDftox+vLChdmho1UbkeBorQ0b860as3UV2E0RqcWXpE7KrCVsQudQcwt8UEwLKk+izKFKDKR45/6vU5cQKNRAjdUdOIeiv5CuaGEs+QR+ZONAVMK/Ogz2WmkBkSIDPYNxp9ucCtMzQP994ES1eNnvNDDo8KimBvBV6ZX8StxLi86PpOHzF/Zu++pPmQHkUBrVuTdbArpGG5C//MJ+dSuywy92+fI07GxLaQlq2fDZkY5b9Qo5d0XWSp6Vi56F8fNvkY1x1znbxDD58qE82lqABMXW8/eI7FSGAUuIVmIrTDF5y8QGCuYYLhk61kVbLhOFaxv2RFArYl3K96VMfn8EcYCuk0Fts3HTYoVActGPoRFjU= alan.maydwell@MJ003801"
},
"preproduction": {},
"production": {}
}
}
4 changes: 2 additions & 2 deletions terraform/environments/corporate-information-system/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ resource "aws_iam_role" "cis_ec2_role" {
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "ec2.amazonaws.com"
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-core/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ locals {
"business_unit_kms_key_access" = aws_iam_policy.business_unit_kms_key_access
}
primary_instance_count = 1
standby_count = 2
standby_count = 2
ebs_volumes = {
"/dev/sdb" = { label = "app", size = 200 } # /u01
"/dev/sdc" = { label = "app", size = 100 } # /u02
Expand Down Expand Up @@ -123,7 +123,7 @@ locals {
}

dms_config_dev = {
deploy_dms = true
deploy_dms = true
replication_instance_class = "dms.t3.small"
engine_version = "3.5.2"
# This map overlaps with the Ansible database configuration in delius-environment-configuration-management/ansible/group_vars
Expand Down
10 changes: 5 additions & 5 deletions terraform/environments/delius-core/locals_preproduction.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ locals {
"business_unit_kms_key_access" = aws_iam_policy.business_unit_kms_key_access
}
primary_instance_count = 0
standby_count = 0
standby_count = 0
ebs_volumes = {
"/dev/sdb" = { label = "app", size = 200 } # /u01
"/dev/sdc" = { label = "app", size = 100 } # /u02
Expand Down Expand Up @@ -129,7 +129,7 @@ locals {
}

dms_config_preprod = {
deploy_dms = false
deploy_dms = false
replication_enabled = false
replication_instance_class = "dms.t3.medium"
engine_version = "3.5.2"
Expand All @@ -140,10 +140,10 @@ locals {
read_database = "PRENDAS1"
}
audit_target_endpoint = {
write_environment = "preprod" # Until production exists set dummy replication target
write_database = "NONE" # Remove this dummy attribute once production target exists
write_environment = "preprod" # Until production exists set dummy replication target
write_database = "NONE" # Remove this dummy attribute once production target exists
}
user_source_endpoint = { # Set this map to {} once production exists
user_source_endpoint = { # Set this map to {} once production exists
read_host = "primarydb"
read_database = "NONE"
}
Expand Down
14 changes: 7 additions & 7 deletions terraform/environments/delius-core/locals_stage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ locals {


db_config_stage = {
instance_type = "r7i.2xlarge"
ami_name_regex = "^delius_core_ol_8_5_oracle_db_19c_patch_2024-06-04T11-24-58.162Z"
instance_type = "r7i.2xlarge"
ami_name_regex = "^delius_core_ol_8_5_oracle_db_19c_patch_2024-06-04T11-24-58.162Z"
primary_instance_count = 1
standby_count = 0
standby_count = 0

instance_policies = {
"business_unit_kms_key_access" = aws_iam_policy.business_unit_kms_key_access
Expand Down Expand Up @@ -128,7 +128,7 @@ locals {
}

dms_config_stage = {
deploy_dms = false
deploy_dms = false
replication_instance_class = "dms.t3.medium"
engine_version = "3.5.2"

Expand All @@ -139,10 +139,10 @@ locals {
read_database = "STGNDA"
}
audit_target_endpoint = {
write_environment = "stage" # Until production exists set dummy replication target
write_database = "NONE" # Remove this dummy attribute once production target exists
write_environment = "stage" # Until production exists set dummy replication target
write_database = "NONE" # Remove this dummy attribute once production target exists
}
user_source_endpoint = { # Set this map to {} once production exists
user_source_endpoint = { # Set this map to {} once production exists
read_host = "primarydb"
read_database = "NONE"
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-core/locals_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ locals {
"business_unit_kms_key_access" = aws_iam_policy.business_unit_kms_key_access
}
primary_instance_count = 1
standby_count = 0
standby_count = 0
ebs_volumes = {
"/dev/sdb" = { label = "app", size = 200 } # /u01
"/dev/sdc" = { label = "app", size = 100 } # /u02
Expand Down Expand Up @@ -123,7 +123,7 @@ locals {
}

dms_config_test = {
deploy_dms = true
deploy_dms = true
replication_instance_class = "dms.t3.medium"
engine_version = "3.5.2"
# This map overlaps with the Ansible database configuration in delius-environment-configuration-management/ansible/group_vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,49 @@ locals {
try(var.dms_config.user_target_endpoint.write_database, null) == null ? {} : {
user_inbound_replication = {
replication_task_arn = aws_dms_replication_task.user_inbound_replication[0].replication_task_arn,
replication_task_id = aws_dms_replication_task.user_inbound_replication[0].replication_task_id
replication_task_id = aws_dms_replication_task.user_inbound_replication[0].replication_task_id
}
},
{ for k in keys(local.client_account_map) :
"business_interaction_inbound_replication_from_${k}" => {
"business_interaction_inbound_replication_from_${k}" => {
replication_task_arn = aws_dms_replication_task.business_interaction_inbound_replication[k].replication_task_arn
replication_task_id = aws_dms_replication_task.business_interaction_inbound_replication[k].replication_task_id
}
replication_task_id = aws_dms_replication_task.business_interaction_inbound_replication[k].replication_task_id
}
},
{ for k in keys(local.client_account_map) :
"audited_interaction_inbound_replication_from_${k}" => {
"audited_interaction_inbound_replication_from_${k}" => {
replication_task_arn = aws_dms_replication_task.audited_interaction_inbound_replication[k].replication_task_arn
replication_task_id = aws_dms_replication_task.audited_interaction_inbound_replication[k].replication_task_id
}
replication_task_id = aws_dms_replication_task.audited_interaction_inbound_replication[k].replication_task_id
}
},
{ for k in keys(local.client_account_map) :
"audited_interaction_checksum_inbound_replication_from_${k}" => {
"audited_interaction_checksum_inbound_replication_from_${k}" => {
replication_task_arn = aws_dms_replication_task.audited_interaction_checksum_inbound_replication[k].replication_task_arn
replication_task_id = aws_dms_replication_task.audited_interaction_checksum_inbound_replication[k].replication_task_id
}
replication_task_id = aws_dms_replication_task.audited_interaction_checksum_inbound_replication[k].replication_task_id
}
},
try(var.dms_config.audit_source_endpoint.read_database, null) == null ? {} : {
audited_interaction_outbound_replication = {
replication_task_arn = aws_dms_replication_task.audited_interaction_outbound_replication[0].replication_task_arn
replication_task_id = aws_dms_replication_task.audited_interaction_outbound_replication[0].replication_task_id
replication_task_id = aws_dms_replication_task.audited_interaction_outbound_replication[0].replication_task_id
}
},
{ for k in keys(local.client_account_map) :
"user_outbound_replication_to_${k}" => {
replication_task_arn = aws_dms_replication_task.user_outbound_replication[k].replication_task_arn
replication_task_id = aws_dms_replication_task.user_outbound_replication[k].replication_task_id
replication_task_id = aws_dms_replication_task.user_outbound_replication[k].replication_task_id
}
},
try(var.dms_config.audit_source_endpoint.read_database, null) == null ? {} : {
business_interaction_outbound_replication = {
replication_task_arn = aws_dms_replication_task.business_interaction_outbound_replication[0].replication_task_arn
replication_task_id = aws_dms_replication_task.business_interaction_outbound_replication[0].replication_task_id
replication_task_id = aws_dms_replication_task.business_interaction_outbound_replication[0].replication_task_id
}
},
try(var.dms_config.audit_source_endpoint.read_database, null) == null ? {} : {
audited_interaction_checksum_outbound_replication = {
replication_task_arn = aws_dms_replication_task.audited_interaction_checksum_outbound_replication[0].replication_task_arn
replication_task_id = aws_dms_replication_task.audited_interaction_checksum_outbound_replication[0].replication_task_id
replication_task_id = aws_dms_replication_task.audited_interaction_checksum_outbound_replication[0].replication_task_id
}
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "dms" {
count = var.dms_config.deploy_dms ? 1 : 0
count = var.dms_config.deploy_dms ? 1 : 0
source = "../components/dms"
account_config = var.account_config
account_info = var.account_info
Expand Down
18 changes: 9 additions & 9 deletions terraform/environments/delius-jitbit/waf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ module "shield" {

waf_acl_rules = {
AWSManagedRulesCommonRuleSet = {
"action" = "count"
"name" = "AWSManagedRulesCommonRuleSet"
"priority" = 0
"action" = "count"
"name" = "AWSManagedRulesCommonRuleSet"
"priority" = 0
"threshold" = 1000
"statement" = {
"managed_rule_group_statement" = {
Expand All @@ -34,9 +34,9 @@ module "shield" {
}
}
AWSManagedRulesSQLiRuleSet = {
"action" = "count"
"name" = "AWSManagedRulesSQLiRuleSet"
"priority" = 1
"action" = "count"
"name" = "AWSManagedRulesSQLiRuleSet"
"priority" = 1
"threshold" = 1000
"statement" = {
"managed_rule_group_statement" = {
Expand All @@ -63,9 +63,9 @@ data "external" "shield_waf" {

locals {
split_arn = split("regional/webacl/", data.external.shield_waf.result["arn"])[1]
name = data.external.shield_waf.result["name"]
id = split("/", local.split_arn)[1]
scope = "REGIONAL"
name = data.external.shield_waf.result["name"]
id = split("/", local.split_arn)[1]
scope = "REGIONAL"

}
import {
Expand Down
Loading

0 comments on commit b614039

Please sign in to comment.