Skip to content

Commit f582355

Browse files
committed
[NRL-760] Set lambda ENVIRONMENT value to env name rather than stack name
1 parent 60e5288 commit f582355

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

terraform/infrastructure/locals.tf

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
locals {
22
region = "eu-west-2"
33
project = "nhsd-nrlf"
4-
environment = terraform.workspace
4+
environment = var.account_name
5+
stack_name = terraform.workspace
56
deletion_protection = var.deletion_protection
6-
prefix = "${local.project}--${local.environment}"
7-
shared_prefix = "${local.project}--${var.account_name}"
7+
prefix = "${local.project}--${local.stack_name}"
8+
shared_prefix = "${local.project}--${local.environment}"
9+
810
kms = {
911
deletion_window_in_days = 7
1012
}
1113

12-
# TODO - Remove once all environments are on new domain structure
13-
env_on_new_dns_zone = ["qa", "qa-sandbox"]
14-
new_domain_map = {
15-
"qa" : "api.${var.domain}",
16-
"qa-sandbox" : "sandbox-api.${var.domain}",
17-
}
18-
1914
apis = {
20-
zone = var.domain
21-
# TODO - Move all other environments onto new domain structure
22-
domain = contains(local.env_on_new_dns_zone, local.environment) ? local.new_domain_map[local.environment] : "${terraform.workspace}.${var.domain}"
15+
zone = var.domain
16+
domain = "${terraform.workspace}.${var.domain}"
2317
consumer = {
2418
path = var.consumer_api_path
2519
}
@@ -29,7 +23,7 @@ locals {
2923
}
3024
dynamodb_timeout_seconds = "3"
3125

32-
is_sandbox_env = length(regexall("-sandbox-", local.environment)) > 0
26+
is_sandbox_env = length(regexall("-sandbox", local.environment)) > 0
3327

3428
public_domain = local.is_sandbox_env ? var.public_sandbox_domain : var.public_domain
3529

0 commit comments

Comments
 (0)