Skip to content

Commit

Permalink
Merge pull request #5398 from ministryofjustice/date_2024_03_18
Browse files Browse the repository at this point in the history
GitHub Actions Code Formatter workflow
  • Loading branch information
ASTRobinson authored Mar 18, 2024
2 parents 9e19eac + 2846fd4 commit 96f7938
Show file tree
Hide file tree
Showing 25 changed files with 103 additions and 101 deletions.
10 changes: 5 additions & 5 deletions terraform/environments/corporate-staff-rostering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _If you have any questions surrounding this page please post in the `#dso-intern

### **Description:**

CSR provides scheduling, annual leave & overtime for around 30,000 Prison Officers and Operational Support Grades. All CSR components are running in Production, with Preproduction hosting training app and web servers. The service is in Modernisation Platform live as of 09/03/2024.
CSR provides scheduling, annual leave & overtime for around 30,000 Prison Officers and Operational Support Grades. All CSR components are running in Production, with Preproduction hosting training app and web servers. The service is in Modernisation Platform live as of 09/03/2024.

### **Service URLs:**

Expand All @@ -37,14 +37,14 @@ trainb.pp.csr.service.justice.gov.uk

### **Incident contact details:**

Email [email protected] for database issues.
Email [email protected] for application issues.
Email [email protected] for infrastructure issues.
Email <[email protected]> for database issues.
Email <[email protected]> for application issues.
Email <[email protected]> for infrastructure issues.

### **Service team contact:**

ask-digital-studio-ops
[email protected]
<[email protected]>

### **Hosting environment:**

Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/dacp/ec2_bastion_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "bastion_linux" {
aws.share-tenant = aws # The default provider (unaliased, `aws`) is the tenant
}
# s3 - used for logs and user ssh public keys
bucket_name = "bastion-example"
bucket_name = "bastion-example"
# bucket_versioning = true
# bucket_force_destroy = true
# public keys
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/dacp/providers.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
provider "aws" {
region = "eu-west-2"
alias = "tacticalproducts"
alias = "tacticalproducts"
}
22 changes: 11 additions & 11 deletions terraform/environments/delius-core/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ locals {
}

merge_api = {
container_port = 8080
image_tag = "REPLACE"
create_rds = true
rds_engine = "postgres"
rds_engine_version = "15"
rds_instance_class = "db.t3.small"
rds_allocated_storage = 30
rds_username = "dbadmin"
rds_port = 5432
rds_license_model = "postgresql-license"
container_port = 8080
image_tag = "REPLACE"
create_rds = true
rds_engine = "postgres"
rds_engine_version = "15"
rds_instance_class = "db.t3.small"
rds_allocated_storage = 30
rds_username = "dbadmin"
rds_port = 5432
rds_license_model = "postgresql-license"
rds_deletion_protection = false
rds_skip_final_snapshot = true
snapshot_identifier = "rds-migration-1145"
snapshot_identifier = "rds-migration-1145"
}

merge_ui = {
Expand Down
22 changes: 11 additions & 11 deletions terraform/environments/delius-core/locals_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ locals {
}

merge_api = {
image_tag = "REPLACE"
container_port = 8080
create_rds = true
rds_engine = "postgres"
rds_engine_version = "15"
rds_instance_class = "db.t3.small"
rds_allocated_storage = 20
rds_username = "dbadmin"
rds_port = 5432
rds_license_model = "postgresql-license"
image_tag = "REPLACE"
container_port = 8080
create_rds = true
rds_engine = "postgres"
rds_engine_version = "15"
rds_instance_class = "db.t3.small"
rds_allocated_storage = 20
rds_username = "dbadmin"
rds_port = 5432
rds_license_model = "postgresql-license"
rds_deletion_protection = false
rds_skip_final_snapshot = true
snapshot_identifier = null
snapshot_identifier = null
}

weblogic = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
locals {
secret_prefix = join("-", [lookup(var.tags, "environment-name", null), lookup(var.tags, "delius-environment", null), lookup(var.tags, "application", null)])
dba_secret_name = "${local.secret_prefix}-dba-passwords"
application_secret_name = "${local.secret_prefix}-application-passwords"
oem_account_id = var.platform_vars.environment_management.account_ids[join("-", ["hmpps-oem", var.account_info.mp_environment])]
secret_prefix = join("-", [lookup(var.tags, "environment-name", null), lookup(var.tags, "delius-environment", null), lookup(var.tags, "application", null)])
dba_secret_name = "${local.secret_prefix}-dba-passwords"
application_secret_name = "${local.secret_prefix}-application-passwords"
oem_account_id = var.platform_vars.environment_management.account_ids[join("-", ["hmpps-oem", var.account_info.mp_environment])]
oracle_statistics_delius_target_account_id = var.env_name == "dev" ? var.platform_vars.environment_management.account_ids["delius-core-test"] : var.env_name == "preprod" ? var.platform_vars.environment_management.account_ids["delius-core-production"] : ""
oracle_statistics_delius_target_environment = var.env_name == "dev" ? "test" : var.env_name == "preprod" ? "prod" : var.env_name == "stage" ? "preprod" : ""
oracle_statistics_delius_source_account_id = var.env_name == "test" ? var.platform_vars.environment_management.account_ids["delius-core-development"] : var.env_name == "prod" ? var.platform_vars.environment_management.account_ids["delius-core-preproduction"] : ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Version": "2012-10-17",

"Statement": [
{
"Sid": "OracleStatisticsListPolicy",
Expand All @@ -17,10 +17,12 @@
"Principal": {
"AWS": "arn:aws:iam::${oracle_statistics_delius_target_account_id}:role/instance-role-${oracle_statistics_delius_target_environment}-delius-db-1"
},
"Action": ["s3:PutObjectAcl",
"s3:PutObject",
"s3:GetObjectTagging",
"s3:GetObject"],
"Action": [
"s3:PutObjectAcl",
"s3:PutObject",
"s3:GetObjectTagging",
"s3:GetObject"
],
"Resource": "${s3bucket_arn}/*"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ data "aws_iam_policy_document" "oracledb_backup_bucket_access" {
data "aws_iam_policy_document" "oracle_remote_statistics_bucket_access" {

statement {
sid = "allowAccessToListOracleStatistics${title(local.oracle_statistics_delius_source_environment)}Bucket"
effect = "Allow"
sid = "allowAccessToListOracleStatistics${title(local.oracle_statistics_delius_source_environment)}Bucket"
effect = "Allow"
actions = [
"s3:ListBucket"
]
resources = ["arn:aws:s3:::${local.oracle_statistics_delius_source_environment}-oracle-statistics-backup-data"]
}

statement {
sid = "allowAccessToOracleStatistics${title(local.oracle_statistics_delius_source_environment)}BucketObjects"
effect = "Allow"
sid = "allowAccessToOracleStatistics${title(local.oracle_statistics_delius_source_environment)}BucketObjects"
effect = "Allow"
actions = [
"s3:PutObjectAcl",
"s3:PutObject",
Expand All @@ -129,9 +129,9 @@ data "aws_iam_policy_document" "oracle_remote_statistics_bucket_access" {

data "aws_iam_policy_document" "combined" {
source_policy_documents = compact([
data.aws_iam_policy_document.oracledb_backup_bucket_access.json,
local.oracle_statistics_delius_source_environment != "" ? data.aws_iam_policy_document.oracle_remote_statistics_bucket_access.json : null
])
data.aws_iam_policy_document.oracledb_backup_bucket_access.json,
local.oracle_statistics_delius_source_environment != "" ? data.aws_iam_policy_document.oracle_remote_statistics_bucket_access.json : null
])
}

resource "aws_iam_policy" "oracledb_backup_bucket_access" {
Expand Down Expand Up @@ -221,12 +221,12 @@ module "s3_bucket_oracle_statistics" {
ownership_controls = "BucketOwnerEnforced"
replication_enabled = false
custom_kms_key = var.account_config.kms_keys.general_shared
bucket_policy = compact([ local.oracle_statistics_delius_target_environment != "" ? templatefile("${path.module}/policies/oracle_statistics_backup_data.json",
{
s3bucket_arn = module.s3_bucket_oracle_statistics.bucket.arn,
oracle_statistics_delius_target_account_id = local.oracle_statistics_delius_target_account_id,
oracle_statistics_delius_target_environment = local.oracle_statistics_delius_target_environment
}) : null])
bucket_policy = compact([local.oracle_statistics_delius_target_environment != "" ? templatefile("${path.module}/policies/oracle_statistics_backup_data.json",
{
s3bucket_arn = module.s3_bucket_oracle_statistics.bucket.arn,
oracle_statistics_delius_target_account_id = local.oracle_statistics_delius_target_account_id,
oracle_statistics_delius_target_environment = local.oracle_statistics_delius_target_environment
}) : null])
providers = {
aws.bucket-replication = aws.bucket-replication
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ module "merge_api_service" {
health_check_path = "/merge/api/actuator/health"
account_info = var.account_info

create_rds = var.delius_microservice_configs.merge_api.create_rds
rds_engine = var.delius_microservice_configs.merge_api.rds_engine
rds_engine_version = var.delius_microservice_configs.merge_api.rds_engine_version
rds_instance_class = var.delius_microservice_configs.merge_api.rds_instance_class
rds_port = var.delius_microservice_configs.merge_api.rds_port
rds_allocated_storage = var.delius_microservice_configs.merge_api.rds_allocated_storage
rds_username = var.delius_microservice_configs.merge_api.rds_username
rds_license_model = var.delius_microservice_configs.merge_api.rds_license_model
create_rds = var.delius_microservice_configs.merge_api.create_rds
rds_engine = var.delius_microservice_configs.merge_api.rds_engine
rds_engine_version = var.delius_microservice_configs.merge_api.rds_engine_version
rds_instance_class = var.delius_microservice_configs.merge_api.rds_instance_class
rds_port = var.delius_microservice_configs.merge_api.rds_port
rds_allocated_storage = var.delius_microservice_configs.merge_api.rds_allocated_storage
rds_username = var.delius_microservice_configs.merge_api.rds_username
rds_license_model = var.delius_microservice_configs.merge_api.rds_license_model
rds_deletion_protection = var.delius_microservice_configs.merge_api.rds_deletion_protection
snapshot_identifier = var.delius_microservice_configs.merge_api.snapshot_identifier
rds_skip_final_snapshot = var.delius_microservice_configs.merge_api.rds_skip_final_snapshot

container_environment_vars = [
{
name = "SERVER_SERVLET_CONTEXT_PATH"
Expand Down
12 changes: 6 additions & 6 deletions terraform/environments/digital-prison-reporting/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ locals {

glue_job_common_log_level = local.application_data.accounts[local.environment].glue_job_common_log_level

kinesis_endpoint = "https://kinesis.eu-west-2.amazonaws.com"
cloud_platform_cidr = "172.20.0.0/16"
enable_dpr_cloudtrail = local.application_data.accounts[local.environment].enable_cloud_trail
generic_lambda = "${local.project}-generic-lambda"
kinesis_endpoint = "https://kinesis.eu-west-2.amazonaws.com"
cloud_platform_cidr = "172.20.0.0/16"
enable_dpr_cloudtrail = local.application_data.accounts[local.environment].enable_cloud_trail
generic_lambda = "${local.project}-generic-lambda"

lambda_log_retention_in_days = local.application_data.accounts[local.environment].lambda_log_retention_in_days
enable_generic_lambda_sg = true # True for all Envs, Common SG Group
enable_generic_lambda_sg = true # True for all Envs, Common SG Group
# DMS Specific
setup_dms_instance = local.application_data.accounts[local.environment].setup_dms_instance
enable_replication_task = local.application_data.accounts[local.environment].enable_dms_replication_task
Expand All @@ -53,7 +53,7 @@ locals {
# Glue Job parameters
glue_placeholder_script_location = "s3://${local.project}-artifact-store-${local.environment}/build-artifacts/digital-prison-reporting-jobs/scripts/digital-prison-reporting-jobs-vLatest.scala"
glue_jobs_latest_jar_location = "s3://${local.project}-artifact-store-${local.environment}/build-artifacts/digital-prison-reporting-jobs/jars/digital-prison-reporting-jobs-vLatest-all.jar"
glue_log_retention_in_days = local.application_data.accounts[local.environment].glue_log_retention_in_days
glue_log_retention_in_days = local.application_data.accounts[local.environment].glue_log_retention_in_days
# Reporting Hub Job
reporting_hub_driver_mem = local.application_data.accounts[local.environment].reporting_hub_spark_driver_mem
reporting_hub_executor_mem = local.application_data.accounts[local.environment].reporting_hub_spark_executor_mem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "aws_cloudwatch_log_group" "dms-instance-log-group" {
var.tags,
{
name = "${var.name}-instance-log-group-${var.env}"
})
})
}

### DMS replication instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ output "dms_s3_iam_policy_admin_arn" {

output "dms_instance_log_group_arn" {
description = "The ARM of the DMS instance log group"
value = var.setup_dms_endpoints && var.setup_dms_instance ? join("", aws_cloudwatch_log_group.dms-instance-log-group.*.arn) : ""
value = var.setup_dms_endpoints && var.setup_dms_instance ? join("", aws_cloudwatch_log_group.dms-instance-log-group.*.arn) : ""
}
28 changes: 14 additions & 14 deletions terraform/environments/hmpps-domain-services/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,25 @@ locals {
}]
},
PatchBucketAccessPolicy = {
description = "Permissions to upload and download patches"
statements = [{
description = "Permissions to upload and download patches"
statements = [{
effect = "Allow"
actions = [
"s3:ListBucket",
]
resources = ["arn:aws:s3:::hmpps-domain-services-development-patch-logs"]
},
{
effect = "Allow"
actions = [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObjectAcl"
]
resources = ["arn:aws:s3:::hmpps-domain-services-development-patch-logs/*"]
}
]}
},
{
effect = "Allow"
actions = [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObjectAcl"
]
resources = ["arn:aws:s3:::hmpps-domain-services-development-patch-logs/*"]
}
] }
}

baseline_iam_roles = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ locals {
baseline_ec2_instances = {
pp-rdgw-1-a = merge(local.rds_ec2_instance, {
config = merge(local.rds_ec2_instance.config, {
availability_zone = "eu-west-2a"
availability_zone = "eu-west-2a"
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
})
tags = merge(local.rds_ec2_instance.tags, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ locals {
baseline_ec2_instances = {
pd-rdgw-1-a = merge(local.rds_ec2_instance, {
config = merge(local.rds_ec2_instance.config, {
availability_zone = "eu-west-2a"
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies,["SSMPolicy", "PatchBucketAccessPolicy"])
availability_zone = "eu-west-2a"
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
})
tags = merge(local.rds_ec2_instance.tags, {
description = "Remote Desktop Gateway for azure.hmpp.root domain"
})
})
pd-rdgw-1-b = merge(local.rds_ec2_instance, {
config = merge(local.rds_ec2_instance.config, {
availability_zone = "eu-west-2b"
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies,["SSMPolicy", "PatchBucketAccessPolicy"])
availability_zone = "eu-west-2b"
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
})
tags = merge(local.rds_ec2_instance.tags, {
description = "Remote Desktop Gateway for azure.hmpp.root domain"
Expand All @@ -59,7 +59,7 @@ locals {
config = merge(local.rds_ec2_instance.config, {
availability_zone = "eu-west-2a"
user_data_raw = base64encode(file("./templates/user-data-domain-join.yaml"))
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies,["SSMPolicy", "PatchBucketAccessPolicy"])
instance_profile_policies = concat(local.rds_ec2_instance.config.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
})
instance = merge(local.rds_ec2_instance.instance, {
instance_type = "t3.large"
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/ncas/ec2_bastion_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "bastion_linux" {
aws.share-tenant = aws # The default provider (unaliased, `aws`) is the tenant
}
# s3 - used for logs and user ssh public keys
bucket_name = "bastion-example"
bucket_name = "bastion-example"
# bucket_versioning = true
# bucket_force_destroy = true
# public keys
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/nomis/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ locals {
oracle-db-hostname-a = "SDPDL0001.azure.noms.root"
oracle-db-hostname-b = "none"
oracle-db-name = "qa11r"
})
})
})
})
}

baseline_lbs = {
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/oasys/locals_production.tf
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ locals {
description = "practice and training ${local.application_name} database"
"${local.application_name}-environment" = "ptctrn"
bip-db-name = "TRBIPINF"
oracle-sids = "PROASYS TROASYS TRBIPINF"
oracle-sids = "PROASYS TROASYS TRBIPINF"
})
})

Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/performance-hub/bastion_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "bastion_linux" {
}

# s3 - used for logs and user ssh public keys
bucket_name = "bastion"
bucket_name = "bastion"
# public keys
public_key_data = local.public_key_data.keys[local.environment]
# logs
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/pra-register/ec2_bastion_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module "bastion_linux" {
aws.share-tenant = aws # The default provider (unaliased, `aws`) is the tenant
}
# s3 - used for logs and user ssh public keys
bucket_name = "bastion-example"
bucket_name = "bastion-example"
# bucket_versioning = true
# bucket_force_destroy = true
# public keys
Expand Down
Loading

0 comments on commit 96f7938

Please sign in to comment.