tryretool/terraform-retool-modules

deployment_name should be used in the aws_service_discovery_private_dns_namespace resource

dmattia opened this issue · 1 comments

The resource here:

https://github.com/tryretool/terraform-retool-modules/blob/main/modules/aws_ecs/main.tf#L390C11-L395

needs to be unique within an AWS account, so it is difficult to deploy two of this module as is.

confirmed. also running into this issue. the overlap prevents the second instance's containers from passing health checks.

@dmattia, i'm assuming you could just fork the module for now and update this chunk:

resource "aws_service_discovery_private_dns_namespace" "retoolsvc" {
  count       = var.workflows_enabled ? 1 : 0
  name        = "retoolsvc"
  description = "Service Discovery namespace for Retool deployment"
  vpc         = var.vpc_id
}

to something like this:

resource "aws_service_discovery_private_dns_namespace" "retoolsvc" {
  count       = var.workflows_enabled ? 1 : 0
  name        = "${var.deployment_name}-retoolsvc"
  description = "Service Discovery namespace for Retool deployment"
  vpc         = var.vpc_id
}