Skip to content
Discussion options

You must be logged in to vote

You don't need a separate shared "DNS logic" component. The domain auto-construction in the ECS components isn't magic built into the ECS cluster. It comes from two things that are already available to any component:

  1. context.tf (via module.this from terraform-null-label) which gives you a formatted name from your namespace, tenant, environment, stage, name, and attributes.
  2. Remote-state lookup on the dns-delegated component, which outputs default_domain_name (e.g. use2.dev.plat.example.com).

You combine them with a simple format() call. Here's how you can do it in your custom EC2 ASG component:

# Pull in the domain from dns-delegated via remote-state
module "dns_delegated" {
  source  = "c…

Replies: 1 comment 3 replies

Comment options

milldr
Feb 27, 2026
Maintainer Sponsor

You must be logged in to vote
3 replies
@jaguer0
Comment options

@milldr
Comment options

milldr Feb 27, 2026
Maintainer Sponsor

Answer selected by jaguer0
@jaguer0
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants