mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(terraform): assert backend and ui network configs alongside gateway
The two existing tests for `tasks_in_public_subnets` only asserted the gateway's `assign_public_ip` and `subnets`, so flipping backend or ui to `assign_public_ip = false` left the suite green while stranding those tasks in public subnets with no route out once the NAT gateway is gone. Extend both existing `alltrue([...])` assertions to cover all three services with the same expected values, and generalize the error messages.
This commit is contained in:
parent
6a821772bd
commit
f044678dbd
1 changed files with 10 additions and 2 deletions
|
|
@ -83,8 +83,12 @@ run "tasks_in_public_subnets_replaces_the_nat_gateway" {
|
|||
condition = alltrue([
|
||||
aws_ecs_service.gateway.network_configuration[0].assign_public_ip == true,
|
||||
aws_ecs_service.gateway.network_configuration[0].subnets == toset(["subnet-module-public"]),
|
||||
aws_ecs_service.backend.network_configuration[0].assign_public_ip == true,
|
||||
aws_ecs_service.backend.network_configuration[0].subnets == toset(["subnet-module-public"]),
|
||||
aws_ecs_service.ui.network_configuration[0].assign_public_ip == true,
|
||||
aws_ecs_service.ui.network_configuration[0].subnets == toset(["subnet-module-public"]),
|
||||
])
|
||||
error_message = "The gateway must land in the public subnets with a public IP, which is the only egress left once the NAT gateway is gone."
|
||||
error_message = "The gateway, backend, and UI services must all land in the public subnets with a public IP, which is the only egress left once the NAT gateway is gone."
|
||||
}
|
||||
|
||||
# The private subnets stay for Aurora and ElastiCache, so the route table is
|
||||
|
|
@ -114,8 +118,12 @@ run "tasks_in_public_subnets_is_inert_on_a_caller_supplied_vpc" {
|
|||
condition = alltrue([
|
||||
aws_ecs_service.gateway.network_configuration[0].assign_public_ip == false,
|
||||
aws_ecs_service.gateway.network_configuration[0].subnets == toset(["subnet-priv-a", "subnet-priv-b"]),
|
||||
aws_ecs_service.backend.network_configuration[0].assign_public_ip == false,
|
||||
aws_ecs_service.backend.network_configuration[0].subnets == toset(["subnet-priv-a", "subnet-priv-b"]),
|
||||
aws_ecs_service.ui.network_configuration[0].assign_public_ip == false,
|
||||
aws_ecs_service.ui.network_configuration[0].subnets == toset(["subnet-priv-a", "subnet-priv-b"]),
|
||||
])
|
||||
error_message = "tasks_in_public_subnets must be ignored when vpc_id is set, leaving the tasks in the caller's private subnets with no public IP."
|
||||
error_message = "tasks_in_public_subnets must be ignored when vpc_id is set, leaving all three services in the caller's private subnets with no public IP."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue