Skip to content

Commit

Permalink
Updates from GitHub Actions Format Code workflow (#3233)
Browse files Browse the repository at this point in the history
Co-authored-by: modernisation-platform-ci <[email protected]>
  • Loading branch information
1 parent a06278f commit 4a9912b
Show file tree
Hide file tree
Showing 87 changed files with 777 additions and 792 deletions.
8 changes: 4 additions & 4 deletions terraform/environments/dacp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ The Divorce Section Search Service (DACP) application is a business critical app

### **Service URLs:**

Dev: https://dacp.hmcts-development.modernisation-platform.service.justice.gov.uk
Dev: <https://dacp.hmcts-development.modernisation-platform.service.justice.gov.uk>

Preproduction: https://dacp.hmcts-preproduction.modernisation-platform.service.justice.gov.uk
Preproduction: <https://dacp.hmcts-preproduction.modernisation-platform.service.justice.gov.uk>

Prod: https://divorce-section-search.service.justice.gov.uk
Prod: <https://divorce-section-search.service.justice.gov.uk>

### **Incident response hours:**

Expand All @@ -45,7 +45,7 @@ Modernisation Platform

### **Other URLs:**

The service's GitHub repository can be found at: https://github.com/ministryofjustice/Dacp
The service's GitHub repository can be found at: <https://github.com/ministryofjustice/Dacp>

### **Expected speed and frequency of releases:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"preproduction": {
"simonytta": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeBrsu9K2qVs2r/fueve0V+5WBY/ZZTNq1UJYhuXIZp [email protected]"
},
"development": {"simonytta": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeBrsu9K2qVs2r/fueve0V+5WBY/ZZTNq1UJYhuXIZp [email protected]"},
"production": {"simonytta": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeBrsu9K2qVs2r/fueve0V+5WBY/ZZTNq1UJYhuXIZp [email protected]"}
"development": {
"simonytta": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeBrsu9K2qVs2r/fueve0V+5WBY/ZZTNq1UJYhuXIZp [email protected]"
},
"production": {
"simonytta": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeBrsu9K2qVs2r/fueve0V+5WBY/ZZTNq1UJYhuXIZp [email protected]"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "glue.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "glue.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"preproduction": "1.1.0",
"production": "1.1.0"
}
}
}
4 changes: 2 additions & 2 deletions terraform/environments/data-platform/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ data "aws_iam_policy_document" "iam_policy_document_for_presigned_url_lambda" {
actions = ["s3:ListBucket"]
resources = [module.s3-bucket.bucket.arn]
condition {
test = "StringLike"
test = "StringLike"
variable = "s3:prefix"
values = ["code/*"]
values = ["code/*"]
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ For example, resource name takes the form
- where environmentname is the name for the delius environment, NOT the Modernisation Platform account name, e.g. `dev`, `stage`, `preprod`
- resourceidentifier is an identifier for the resource that together with the environmentname gives full clarity about what the resource represents, e.g. `ldap-efs` or `delius-db-1`
e.g.
`dev-ldap-efs`
`preprod-delius-db-1`
`dev-ldap-efs`
`preprod-delius-db-1`
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ locals {
}

db_config_higher_environments = {
name = "db_for_higher_environments"
name = "db_for_higher_environments"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
"db_multi_az": "false",
"db_iam_database_authentication_enabled": "false",
"db_monitoring_interval": "5",
"db_enabled_cloudwatch_logs_exports": [
"alert",
"listener"
],
"db_enabled_cloudwatch_logs_exports": ["alert", "listener"],
"db_performance_insights_enabled": "false",
"db_skip_final_snapshot": "true",
"ec2_iaps_instance_type": "t3.medium",
Expand Down
22 changes: 5 additions & 17 deletions terraform/environments/delius-jitbit/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"db_multi_az": "false",
"db_iam_database_authentication_enabled": "false",
"db_monitoring_interval": "5",
"db_enabled_cloudwatch_logs_exports": [
"agent",
"error"
],
"db_enabled_cloudwatch_logs_exports": ["agent", "error"],
"db_performance_insights_enabled": "false",
"db_deletion_protection": "true",
"db_delete_automated_backups": "false",
Expand All @@ -46,10 +43,7 @@
"db_multi_az": "false",
"db_iam_database_authentication_enabled": "false",
"db_monitoring_interval": "5",
"db_enabled_cloudwatch_logs_exports": [
"agent",
"error"
],
"db_enabled_cloudwatch_logs_exports": ["agent", "error"],
"db_performance_insights_enabled": "false",
"db_deletion_protection": "true",
"db_delete_automated_backups": "false",
Expand All @@ -74,10 +68,7 @@
"db_multi_az": "false",
"db_iam_database_authentication_enabled": "false",
"db_monitoring_interval": "5",
"db_enabled_cloudwatch_logs_exports": [
"agent",
"error"
],
"db_enabled_cloudwatch_logs_exports": ["agent", "error"],
"db_performance_insights_enabled": "false",
"db_deletion_protection": "true",
"db_delete_automated_backups": "false",
Expand All @@ -102,10 +93,7 @@
"db_multi_az": "true",
"db_iam_database_authentication_enabled": "false",
"db_monitoring_interval": "5",
"db_enabled_cloudwatch_logs_exports": [
"agent",
"error"
],
"db_enabled_cloudwatch_logs_exports": ["agent", "error"],
"db_performance_insights_enabled": "true",
"db_deletion_protection": "true",
"db_skip_final_snapshot": "false",
Expand All @@ -114,4 +102,4 @@
"db_final_snapshot_identifier": "jitbit-prod-final"
}
}
}
}
4 changes: 2 additions & 2 deletions terraform/environments/delius-jitbit/lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_security_group" "load_balancer_security_group" {
# Temporary until we can validate ACM cert during migration of production
# The LB SG will block inbound on HTTP 80 but this is to get the apply to work
resource "aws_lb_listener" "listener-prod" {
count = local.is-production ? 1 : 0
count = local.is-production ? 1 : 0
load_balancer_arn = aws_lb.external.id
port = 80
protocol = "HTTP"
Expand All @@ -81,7 +81,7 @@ resource "aws_lb_listener" "listener-prod" {
}

resource "aws_lb_listener" "listener" {
count = local.is-production ? 0 : 1
count = local.is-production ? 0 : 1
load_balancer_arn = aws_lb.external.id
port = 443
protocol = "HTTPS"
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/delius-jitbit/route53.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "aws_route53_zone" "network-services-production" {
count = local.is-production ? 1 : 0
count = local.is-production ? 1 : 0
provider = aws.core-network-services

name = "jitbit.cr.probation.service.justice.gov.uk."
Expand Down Expand Up @@ -89,7 +89,7 @@ resource "aws_route53_record" "external_validation_subdomain" {
# }

resource "aws_acm_certificate_validation" "external" {
count = local.is-production ? 0 : 1 # Temporary until we have a production dns delegation in place
count = local.is-production ? 0 : 1 # Temporary until we have a production dns delegation in place
certificate_arn = aws_acm_certificate.external.arn
validation_record_fqdns = [local.domain_name_main[0], local.domain_name_sub[0]]
}
2 changes: 1 addition & 1 deletion terraform/environments/digital-prison-reporting/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data "aws_secretsmanager_secret" "slack_integration" {
}

data "aws_secretsmanager_secret_version" "slack_integration" {
count = local.enable_slack_alerts ? 1 : 0
count = local.enable_slack_alerts ? 1 : 0
secret_id = data.aws_secretsmanager_secret.slack_integration[0].id
}

Expand Down
94 changes: 47 additions & 47 deletions terraform/environments/digital-prison-reporting/domain_builder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##########################
# Generate API Secret for Serverless Lambda Gateway
module "domain_builder_api_key" {
count = local.enable_dbuilder_lambda || local.enable_domain_builder_agent ? 1 : 0
count = local.enable_dbuilder_lambda || local.enable_domain_builder_agent ? 1 : 0

source = "./modules/secrets_manager"
name = "${local.project}-domain-api-key-${local.environment}"
Expand All @@ -20,7 +20,7 @@ module "domain_builder_api_key" {
Resource_Group = "domain-builder"
Jira = "DPR-604"
Resource_Type = "Secret"
Name = "${local.project}-domain-api-key-${local.environment}"
Name = "${local.project}-domain-api-key-${local.environment}"
}
)
}
Expand Down Expand Up @@ -63,7 +63,7 @@ module "domain_builder_backend_Lambda" {
Resource_Group = "domain-builder"
Jira = "DPR-407"
Resource_Type = "lambda"
Name = local.lambda_dbuilder_name
Name = local.lambda_dbuilder_name
}
)

Expand Down Expand Up @@ -125,19 +125,19 @@ module "domain_builder_cli_agent" {
app_key = "domain-builder"

env_vars = {
DOMAIN_API_KEY = tostring(try(module.domain_builder_api_key[0].secret, null))
REST_API_EXEC_ARN = tostring(try(module.domain_builder_api_gateway[0].rest_api_execution_arn, null))
REST_API_ID = tostring(try(module.domain_builder_api_gateway[0].rest_api_id, null))
ENV = local.env
DOMAIN_API_KEY = tostring(try(module.domain_builder_api_key[0].secret, null))
REST_API_EXEC_ARN = tostring(try(module.domain_builder_api_gateway[0].rest_api_execution_arn, null))
REST_API_ID = tostring(try(module.domain_builder_api_gateway[0].rest_api_id, null))
ENV = local.env
}

tags = merge(
local.all_tags,
{
Name = "${local.project}-domain-builder-agent-${local.env}"
Resource_Type = "EC2 Instance"
Resource_Group = "domain-builder"
Name = "${local.project}-domain-builder-agent-${local.env}"
Name = "${local.project}-domain-builder-agent-${local.env}"
Resource_Type = "EC2 Instance"
Resource_Group = "domain-builder"
Name = "${local.project}-domain-builder-agent-${local.env}"
}
)

Expand All @@ -148,26 +148,26 @@ module "domain_builder_cli_agent" {
module "domain_builder_flyway_Lambda" {
source = "./modules/lambdas/generic"

enable_lambda = local.enable_dbuilder_flyway_lambda
name = local.flyway_dbuilder_name
s3_bucket = local.flyway_dbuilder_code_s3_bucket
s3_key = local.flyway_dbuilder_code_s3_key
handler = local.flyway_dbuilder_handler
runtime = local.flyway_dbuilder_runtime
policies = local.flyway_dbuilder_policies
tracing = local.flyway_dbuilder_tracing
timeout = 60
lambda_trigger = true
trigger_bucket_arn = module.s3_artifacts_store.bucket_arn
enable_lambda = local.enable_dbuilder_flyway_lambda
name = local.flyway_dbuilder_name
s3_bucket = local.flyway_dbuilder_code_s3_bucket
s3_key = local.flyway_dbuilder_code_s3_key
handler = local.flyway_dbuilder_handler
runtime = local.flyway_dbuilder_runtime
policies = local.flyway_dbuilder_policies
tracing = local.flyway_dbuilder_tracing
timeout = 60
lambda_trigger = true
trigger_bucket_arn = module.s3_artifacts_store.bucket_arn

env_vars = {
"DB_CONNECTION_STRING" = "jdbc:postgresql://${module.domain_builder_backend_db.rds_host}/${local.rds_dbuilder_db_identifier}"
"DB_USERNAME" = local.rds_dbuilder_user
"DB_PASSWORD" = module.domain_builder_backend_db.master_password
"FLYWAY_METHOD" = "migrate"
"GIT_BRANCH" = "main"
"GIT_FOLDERS" = "backend/src/main/resources/db/migration"
"GIT_REPOSITORY" = "https://github.com/ministryofjustice/digital-prison-reporting-domain-builder"
"DB_CONNECTION_STRING" = "jdbc:postgresql://${module.domain_builder_backend_db.rds_host}/${local.rds_dbuilder_db_identifier}"
"DB_USERNAME" = local.rds_dbuilder_user
"DB_PASSWORD" = module.domain_builder_backend_db.master_password
"FLYWAY_METHOD" = "migrate"
"GIT_BRANCH" = "main"
"GIT_FOLDERS" = "backend/src/main/resources/db/migration"
"GIT_REPOSITORY" = "https://github.com/ministryofjustice/digital-prison-reporting-domain-builder"
}

vpc_settings = {
Expand All @@ -178,8 +178,8 @@ module "domain_builder_flyway_Lambda" {
tags = merge(
local.all_tags,
{
Name = local.flyway_dbuilder_name
Jira = "DPR-584"
Name = local.flyway_dbuilder_name
Jira = "DPR-584"
Resource_Group = "domain-builder"
Resource_Type = "lambda"
}
Expand All @@ -189,13 +189,13 @@ module "domain_builder_flyway_Lambda" {

# Deploy API GW VPC Link
module "domain_builder_gw_vpclink" {
count = local.include_dbuilder_gw_vpclink == true ? 1 : 0
count = local.include_dbuilder_gw_vpclink == true ? 1 : 0

source = "./modules/vpc_endpoint"
vpc_id = local.dpr_vpc
region = local.account_region
subnet_ids = [data.aws_subnet.data_subnets_a.id, data.aws_subnet.data_subnets_b.id, data.aws_subnet.data_subnets_c.id]
security_group_ids = local.enable_dbuilder_serverless_gw ? [aws_security_group.gateway_endpoint_sg[0].id, ] : []
source = "./modules/vpc_endpoint"
vpc_id = local.dpr_vpc
region = local.account_region
subnet_ids = [data.aws_subnet.data_subnets_a.id, data.aws_subnet.data_subnets_b.id, data.aws_subnet.data_subnets_c.id]
security_group_ids = local.enable_dbuilder_serverless_gw ? [aws_security_group.gateway_endpoint_sg[0].id, ] : []

tags = merge(
local.all_tags,
Expand All @@ -209,16 +209,16 @@ module "domain_builder_gw_vpclink" {

# Domain Builder API Gateway
module "domain_builder_api_gateway" {
count = local.enable_dbuilder_serverless_gw == true ? 1 : 0

source = "./modules/apigateway/serverless-lambda-gw"
enable_gateway = local.enable_dbuilder_serverless_gw
name = local.serverless_gw_dbuilder_name
lambda_arn = module.domain_builder_backend_Lambda.lambda_invoke_arn
lambda_name = module.domain_builder_backend_Lambda.lambda_name
subnet_ids = [data.aws_subnet.data_subnets_a.id, data.aws_subnet.data_subnets_b.id, data.aws_subnet.data_subnets_c.id]
security_group_ids = local.enable_dbuilder_serverless_gw ? [aws_security_group.serverless_gw[0].id, ] : []
endpoint_ids = [data.aws_vpc_endpoint.api.id, ] # This Endpoint is managed and provisioned by MP Team, Dev "vpce-05d9421e74348aafb"
count = local.enable_dbuilder_serverless_gw == true ? 1 : 0

source = "./modules/apigateway/serverless-lambda-gw"
enable_gateway = local.enable_dbuilder_serverless_gw
name = local.serverless_gw_dbuilder_name
lambda_arn = module.domain_builder_backend_Lambda.lambda_invoke_arn
lambda_name = module.domain_builder_backend_Lambda.lambda_name
subnet_ids = [data.aws_subnet.data_subnets_a.id, data.aws_subnet.data_subnets_b.id, data.aws_subnet.data_subnets_c.id]
security_group_ids = local.enable_dbuilder_serverless_gw ? [aws_security_group.serverless_gw[0].id, ] : []
endpoint_ids = [data.aws_vpc_endpoint.api.id, ] # This Endpoint is managed and provisioned by MP Team, Dev "vpce-05d9421e74348aafb"

tags = merge(
local.all_tags,
Expand Down
Loading

0 comments on commit 4a9912b

Please sign in to comment.