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

Tm/tm 658/onr client 3 1 #8582

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,18 @@ locals {
scale_down = { recurrence = "0 19 * * Mon-Fri", desired_capacity = 0 }
}
})

jumpserver = merge(local.ec2_instances.jumpserver, {
autoscaling_group = {
desired_capacity = 1
max_size = 1
force_delete = true
vpc_zone_identifier = module.environment.subnets["private"].ids
}
autoscaling_schedules = {
scale_up = { recurrence = "0 7 * * Mon-Fri" }
scale_down = { recurrence = "0 19 * * Mon-Fri", desired_capacity = 0 }
}
})
}
}
33 changes: 29 additions & 4 deletions terraform/environments/oasys-national-reporting/locals_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ locals {
instance_profile_policies = concat(local.ec2_autoscaling_groups.bods.config.instance_profile_policies, [
"Ec2SecretPolicy",
])
# user_data_raw = base64encode(templatefile(
# "./templates/user-data-onr-bods-pwsh.yaml.tftpl", {
# branch = "TM/TM-620/test-pagefile-change"
# }))
user_data_raw = base64encode(templatefile(
"./templates/user-data-onr-bods-pwsh.yaml.tftpl", {
branch = "TM/TM-659/make-user-data-scripts-idempotent"
}))
})
instance = merge(local.ec2_autoscaling_groups.bods.instance, {
instance_type = "m4.xlarge"
Expand All @@ -147,6 +147,31 @@ locals {
})
cloudwatch_metric_alarms = null
})

# TODO: this is just for testing, remove when not needed
t2-client-asg = merge(local.ec2_instances.jumpserver, {
autoscaling_group = merge(local.ec2_autoscaling_groups.jumpserver.autoscaling_group, {
desired_capacity = 0
})
config = merge(local.ec2_instances.jumpserver.config, {
instance_profile_policies = concat(local.ec2_instances.jumpserver.config.instance_profile_policies, [
"Ec2SecretPolicy",
])
user_data_raw = base64encode(templatefile(
"../../modules/baseline_presets/ec2-user-data/user-data-pwsh.yaml.tftpl", {
branch = "TM/TM-659/make-user-data-scripts-idempotent"
}))
})
instance = merge(local.ec2_instances.jumpserver.instance, {
instance_type = "m4.large"
})
tags = merge(local.ec2_instances.jumpserver.tags, {
oasys-national-reporting-environment = "t2"
domain-name = "azure.noms.root"
server-type = "NartClient"
})
cloudwatch_metric_alarms = null
})
}

ec2_instances = {
Expand Down
5 changes: 5 additions & 0 deletions terraform/environments/oasys-national-reporting/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ module "baseline" {
lookup(local.baseline_environment_specific, "s3_buckets", {}),
)

schedule_alarms_lambda = merge(
lookup(local.baseline_all_environments, "schedule_alarms_lambda", {}),
lookup(local.baseline_environment_specific, "schedule_alarms_lambda", {}),
)

secretsmanager_secrets = merge(
module.baseline_presets.secretsmanager_secrets,
lookup(local.baseline_all_environments, "secretsmanager_secrets", {}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ tasks:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # since powershell 4 uses Tls1 as default
Invoke-WebRequest "https://raw.githubusercontent.com/ministryofjustice/modernisation-platform-configuration-management/$${GitBranch}/powershell/Scripts/Run-GitScript.ps1" -OutFile "Run-GitScript.ps1"
. ./Run-GitScript.ps1 $Script -GitBranch $GitBranch
Exit $LASTEXITCODE
Exit $LASTEXITCODE
Loading