Skip to content

Commit 37c6212

Browse files
VIA-345 AJ Try dynamic ingestion of mock api and app urls
1 parent 77f4e68 commit 37c6212

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

infrastructure/environments/test/fake-api/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ module "fake_api_service" {
5050
ecs_cluster_id = module.ecs_cluster.cluster_id
5151
ecs_cluster_name = module.ecs_cluster.cluster_name
5252
alb_arn = module.alb.arn
53+
alb_dns_name = module.alb.dns_name
54+
app_root_url = var.app_root_url
5355
alb_security_group_id = module.alb.security_group_id
5456

5557
# IAM config (now using outputs from the iam module)

infrastructure/environments/test/fake-api/modules/ecs-service/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ resource "aws_ecs_task_definition" "main" {
9292
hostPort = var.container_port
9393
}
9494
]
95+
environment = [
96+
{
97+
name = "LOGIN_ROOT_URL"
98+
value = var.alb_dns_name
99+
},
100+
{
101+
name = "APP_ROOT_URL"
102+
value = var.app_root_url
103+
}
104+
]
95105
logConfiguration = {
96106
logDriver = "awslogs"
97107
options = {

infrastructure/environments/test/fake-api/modules/ecs-service/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ variable "alb_arn" {
5353
description = "The ARN of the Application Load Balancer."
5454
type = string
5555
}
56+
variable "alb_dns_name" {
57+
description = "The DNS name of the Application Load Balancer."
58+
type = string
59+
}
60+
variable "app_root_url" {
61+
description = "The root URL of the application"
62+
type = string
63+
}
5664
variable "alb_security_group_id" {
5765
description = "The security group ID of the ALB."
5866
type = string

infrastructure/environments/test/fake-api/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ variable "availability_zones" {
1515
type = list(string)
1616
default = ["eu-west-2a", "eu-west-2b"]
1717
}
18+
19+
variable "app_root_url" {
20+
description = "URL of the application"
21+
type = string
22+
default = "https://test.vaccinations.nhs.uk"
23+
}

0 commit comments

Comments
 (0)