Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions Code Formatter workflow #5525

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"integrity": "sha256:37a9344050e0a16eee8db51693ebe26be7023d5babea2d7848720be4ce619617"
}
}
}
}
2 changes: 1 addition & 1 deletion terraform/environments/cdpt-chaps/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ resource "aws_security_group" "db" {
from_port = 1433
to_port = 1433
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/cdpt-ifs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!-- This is a template that should be populated by the development team when moving to the modernisation platform, but also reviewed and kept up to date.
To ensure that people looking at your runbook can get the information they need quickly, your runbook should be short but clear. Throughout, only use acronyms if you’re confident that someone who has just been woken up at 3am would understand them. -->

_If you have any questions surrounding this page please post in the `#cdpt-integrated-fraud-system` channel,
or email ifs-support@digital.justice.gov.uk._
_If you have any questions surrounding this page please post in the `#cdpt-integrated-fraud-system` channel,
or email <ifs-support@digital.justice.gov.uk>._

## Mandatory Information

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ locals {
cloudwatch_monitoring_options = {
enable_cloudwatch_monitoring_account = false
enable_cloudwatch_cross_account_sharing = false
}
}
}
4 changes: 2 additions & 2 deletions terraform/environments/corporate-staff-rostering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ module "baseline" {
}

module "cross_account_cloudwatch" {
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
options = merge(
local.cloudwatch_monitoring_options,
local.cloudwatch_local_environment_monitoring_options,
Expand Down
20 changes: 10 additions & 10 deletions terraform/environments/dacp/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ resource "aws_ecs_task_definition" "dacp_task_definition" {
memory = 4096
container_definitions = jsonencode([
{
name = "dacp-container"
image = "${aws_ecr_repository.dacp_ecr_repo.repository_url}:latest"
cpu = 2048
memory = 4096
essential = true
name = "dacp-container"
image = "${aws_ecr_repository.dacp_ecr_repo.repository_url}:latest"
cpu = 2048
memory = 4096
essential = true
ReadonlyRootFilesystem = true
logConfiguration = {
logDriver = "awslogs",
Expand Down Expand Up @@ -102,11 +102,11 @@ resource "aws_ecs_task_definition" "dacp_task_definition_dev" {
memory = 4096
container_definitions = jsonencode([
{
name = "dacp-container"
image = "${aws_ecr_repository.dacp_ecr_repo.repository_url}:latest"
cpu = 2048
memory = 4096
essential = true
name = "dacp-container"
image = "${aws_ecr_repository.dacp_ecr_repo.repository_url}:latest"
cpu = 2048
memory = 4096
essential = true
ReadonlyRootFilesystem = true
logConfiguration = {
logDriver = "awslogs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"AWS": "arn:aws:iam::${oracle_duplicate_delius_target_account_id}:role/instance-role-${oracle_duplicate_delius_target_environment}-delius-db-1"
},
"Action": "s3:*",
"Resource": [
"${s3bucket_arn}",
"${s3bucket_arn}/*"
]
"Resource": ["${s3bucket_arn}", "${s3bucket_arn}/*"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ module "s3_bucket_oracledb_backups" {
ownership_controls = "BucketOwnerEnforced"
replication_enabled = false
custom_kms_key = var.account_config.kms_keys.general_shared
bucket_policy = compact([local.oracle_duplicate_delius_target_environment != "" ? templatefile("${path.module}/policies/oracledb_backup_data.json",
bucket_policy = compact([local.oracle_duplicate_delius_target_environment != "" ? templatefile("${path.module}/policies/oracledb_backup_data.json",
{
s3bucket_arn = module.s3_bucket_oracledb_backups.bucket.arn,
s3bucket_arn = module.s3_bucket_oracledb_backups.bucket.arn,
oracle_duplicate_delius_target_account_id = local.oracle_duplicate_delius_target_account_id,
oracle_duplicate_delius_target_environment = local.oracle_duplicate_delius_target_environment
}) : null])
}) : null])
providers = {
aws.bucket-replication = aws.bucket-replication
}
Expand Down Expand Up @@ -147,8 +147,8 @@ data "aws_iam_policy_document" "oracledb_remote_backup_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,
local.oracle_duplicate_delius_source_environment != "" ? data.aws_iam_policy_document.oracledb_remote_backup_bucket_access.json: null
local.oracle_statistics_delius_source_environment != "" ? data.aws_iam_policy_document.oracle_remote_statistics_bucket_access.json : null,
local.oracle_duplicate_delius_source_environment != "" ? data.aws_iam_policy_document.oracledb_remote_backup_bucket_access.json : null
])
}

Expand Down
16 changes: 8 additions & 8 deletions terraform/environments/delius-nextcloud/locals.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
locals {
environments_per_account = {
# account = [env1, env2]
prod = [] # prod
pre_prod = [] # stage, pre-prod
test = []
dev = ["dev"]
}
environments_per_account = {
# account = [env1, env2]
prod = [] # prod
pre_prod = [] # stage, pre-prod
test = []
dev = ["dev"]
}

ordered_subnet_ids = [data.aws_subnets.shared-private-a.ids[0], data.aws_subnets.shared-private-b.ids[0], data.aws_subnets.shared-private-c.ids[0]]
ordered_subnet_ids = [data.aws_subnets.shared-private-a.ids[0], data.aws_subnets.shared-private-b.ids[0], data.aws_subnets.shared-private-c.ids[0]]
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ module "nextcloud_service" {
}
]

log_error_pattern = "FATAL"
sns_topic_arn = aws_sns_topic.nextcloud_alarms.arn
log_error_pattern = "FATAL"
sns_topic_arn = aws_sns_topic.nextcloud_alarms.arn
frontend_lb_arn_suffix = aws_alb.nextcloud.arn_suffix

platform_vars = var.platform_vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ variable "bastion_config" {
}

variable "nextcloud_config" {
type = any
type = any
}
variable "tags" {
type = any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ locals {

dev-rhel85 = {
config = merge(module.baseline_presets.ec2_instance.config.default, {
ami_name = "base_rhel_8_5*"
availability_zone = null
instance_profile_policies = concat(module.baseline_presets.ec2_instance.config.default.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
ami_name = "base_rhel_8_5*"
availability_zone = null
instance_profile_policies = concat(module.baseline_presets.ec2_instance.config.default.instance_profile_policies, ["SSMPolicy", "PatchBucketAccessPolicy"])
})
instance = merge(module.baseline_presets.ec2_instance.instance.default, {
vpc_security_group_ids = ["rds-ec2s"]
Expand Down
8 changes: 4 additions & 4 deletions terraform/environments/hmpps-oem/locals_oem.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ locals {
# (modernisation-platform-oidc-cicd only currently required in Delius dev & test environments)
oem_share_secret_principal_ids = flatten([
for key, value in module.environment.account_ids :
concat (
contains(local.oem_managed_applications, key) ? ["arn:aws:iam::${value}:role/EC2OracleEnterpriseManagementSecretsRole"] : [],
contains(["development", "test"], local.environment) && contains(["delius-core-${local.environment}"], key) ? ["arn:aws:iam::${value}:role/modernisation-platform-oidc-cicd"] : []
)
concat(
contains(local.oem_managed_applications, key) ? ["arn:aws:iam::${value}:role/EC2OracleEnterpriseManagementSecretsRole"] : [],
contains(["development", "test"], local.environment) && contains(["delius-core-${local.environment}"], key) ? ["arn:aws:iam::${value}:role/modernisation-platform-oidc-cicd"] : []
)
])

oem_secret_policy_write = {
Expand Down
8 changes: 4 additions & 4 deletions terraform/environments/hmpps-oem/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ module "baseline" {
}

module "cross_account_cloudwatch" {
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
options = merge(
local.cloudwatch_monitoring_options,
local.cloudwatch_local_environment_monitoring_options,
)
}

module "cloudwatch" {
source = "../../modules/cloudwatch"
environment = module.environment
source = "../../modules/cloudwatch"
environment = module.environment
options = merge(
local.cloudwatch_monitoring_options,
local.cloudwatch_local_environment_monitoring_options,
Expand Down
20 changes: 10 additions & 10 deletions terraform/environments/ncas/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ resource "aws_ecs_task_definition" "ncas_task_definition" {
memory = 2048
container_definitions = jsonencode([
{
name = "ncas-container"
image = "${aws_ecr_repository.ncas_ecr_repo.repository_url}:latest"
cpu = 1024
memory = 2048
essential = true
name = "ncas-container"
image = "${aws_ecr_repository.ncas_ecr_repo.repository_url}:latest"
cpu = 1024
memory = 2048
essential = true
ReadonlyRootFilesystem = true
logConfiguration = {
logDriver = "awslogs",
Expand Down Expand Up @@ -102,11 +102,11 @@ resource "aws_ecs_task_definition" "ncas_task_definition_dev" {
memory = 2048
container_definitions = jsonencode([
{
name = "ncas-container"
image = "${aws_ecr_repository.ncas_ecr_repo.repository_url}:latest"
cpu = 1024
memory = 2048
essential = true
name = "ncas-container"
image = "${aws_ecr_repository.ncas_ecr_repo.repository_url}:latest"
cpu = 1024
memory = 2048
essential = true
ReadonlyRootFilesystem = true
logConfiguration = {
logDriver = "awslogs",
Expand Down
8 changes: 4 additions & 4 deletions terraform/environments/nomis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ module "baseline" {
}

module "cross_account_cloudwatch" {
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
source = "../../modules/cross_account_cloudwatch"
environment = module.environment
options = merge(
local.cloudwatch_monitoring_options,
local.cloudwatch_local_environment_monitoring_options,
)
}

module "cloudwatch" {
source = "../../modules/cloudwatch"
environment = module.environment
source = "../../modules/cloudwatch"
environment = module.environment
options = merge(
local.cloudwatch_monitoring_options,
local.cloudwatch_local_environment_monitoring_options,
Expand Down
10 changes: 5 additions & 5 deletions terraform/environments/oasys-national-reporting/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ locals {
baseline_security_groups = {
# instance type security groups
# loadbalancer = local.security_groups.loadbalancer
web = local.security_groups.web # apply to onr web servers
bods = local.security_groups.bods
boe = local.security_groups.boe
onr_db = local.security_groups.onr_db
web = local.security_groups.web # apply to onr web servers
bods = local.security_groups.bods
boe = local.security_groups.boe
onr_db = local.security_groups.onr_db

# shared security groups
oasys_db = local.security_groups.oasys_db # apply to bods & boe servers
oasys_db = local.security_groups.oasys_db # apply to bods & boe servers
oasys_db_onr_db = local.security_groups.oasys_db_onr_db # apply to onr_db prod server
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ locals {
vpc_security_group_ids = ["web"]
})
tags = {
os-type = "Linux"
component = "onr_web"
os-type = "Linux"
component = "onr_web"
}
# FIXME: ebs_volumes list is NOT YET CORRECT and will need to change
ebs_volumes = {
"/dev/sda1" = { type = "gp3", size = 128 } # root volume
"/dev/sda1" = { type = "gp3", size = 128 } # root volume
}
# cloudwatch_metric_alarms = local.ec2_cloudwatch_metric_alarms.web off for now
})

defaults_boe_ec2 = merge(local.defaults_ec2, {
config = merge(local.defaults_ec2.config, {
ami_owner = "374269020027"
ami_name = "base_rhel_6_10_2024-03-26*"
ami_name = "base_rhel_6_10_2024-03-26*"
})
instance = merge(local.defaults_ec2.instance, {
vpc_security_group_ids = ["boe", "oasys_db"]
Expand All @@ -69,7 +69,7 @@ locals {
}
# FIXME: ebs_volumes list is NOT YET CORRECT and will need to change
ebs_volumes = {
"/dev/sda1" = { type = "gp3", size = 128 } # root volume
"/dev/sda1" = { type = "gp3", size = 128 } # root volume
}
})

Expand Down Expand Up @@ -127,6 +127,6 @@ locals {
os-type = "Windows"
component = "onr_db"
}
route53_records = module.baseline_presets.ec2_instance.route53_records.internal_and_external
route53_records = module.baseline_presets.ec2_instance.route53_records.internal_and_external
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ locals {
# })
# })
# }
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
# module.ip_addresses.mp_cidrs.ad_fixngo_azure_domain_controllers,
# ])
# jumpservers = module.ip_addresses.azure_fixngo_cidrs.devtest_jumpservers
noms_core = module.ip_addresses.azure_fixngo_cidrs.devtest_core
noms_core = module.ip_addresses.azure_fixngo_cidrs.devtest_core
oasys_db = flatten([
module.ip_addresses.mp_cidr[module.environment.vpc_name],
module.ip_addresses.azure_fixngo_cidrs.devtest_oasys_db,
Expand All @@ -22,7 +22,7 @@ locals {
# # module.ip_addresses.mp_cidrs.ad_fixngo_hmpp_domain_controllers, # hits rule limit, remove azure DCs first
# ])
# jumpservers = module.ip_addresses.azure_fixngo_cidrs.prod_jumpservers
noms_core = module.ip_addresses.azure_fixngo_cidrs.prod_core
noms_core = module.ip_addresses.azure_fixngo_cidrs.prod_core
oasys_db = flatten([
module.ip_addresses.mp_cidr[module.environment.vpc_name],
module.ip_addresses.azure_fixngo_cidrs.prod_oasys_db,
Expand Down Expand Up @@ -140,7 +140,7 @@ locals {
to_port = 0
protocol = -1
self = true
security_groups = ["web", "onr_db"]
security_groups = ["web", "onr_db"]
}
}
egress = {
Expand All @@ -158,11 +158,11 @@ locals {
description = "Security group for BODS servers"
ingress = {
all-from-self = {
description = "Allow all ingress to self"
from_port = 0
to_port = 0
protocol = -1
self = true
description = "Allow all ingress to self"
from_port = 0
to_port = 0
protocol = -1
self = true
security_groups = ["onr_db"]
}
}
Expand All @@ -180,11 +180,11 @@ locals {
description = "Security group for ONR DB server"
ingress = {
all-from-self = {
description = "Allow all ingress to self"
from_port = 0
to_port = 0
protocol = -1
self = true
description = "Allow all ingress to self"
from_port = 0
to_port = 0
protocol = -1
self = true
security_groups = ["boe", "bods"]
}
onr_db_oem_agent = {
Expand Down
Loading
Loading