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

Updating family to use ecs_service_name var #8

Merged
merged 14 commits into from
Jan 17, 2024
Merged
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module "exec_label" {

resource "aws_ecs_task_definition" "default" {
count = local.create_task_definition ? 1 : 0
family = module.this.name
family = var.ecs_service_name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecs_service_name isn't a required variable, and can be null.
If you want this the same as the service name (probably a good idea), make sure you're setting it to the same things as the service name. In this case, that would be var.ecs_service_name != null ? var.ecs_service_name : module.this.id

Though looking at it again, I think that should actually be module.service_label.id (both here and in the actual aws_ecs_service resource definition further down. service_label sets label_order to ["name", "attributes"], so two service task modules with the same "name" but different attributes (ie "web" vs "worker") should have things named uniquely.

container_definitions = var.container_definition_json
requires_compatibilities = [var.launch_type]
network_mode = var.network_mode
Expand Down