title: AWS ECS Containers and External DNS
body: <ul>
  <li>We have AWS ECS instances.</li>
  <li>We're using an external service (Twilio) that needs to reach a specific container:port.</li>
  <li>And it's SSL, so it has to be a DNS name</li>
  </ul>
  <p>Currently, our Upgrade scripts assigns each container an entry in Route53, and I can use a combination of nslookup and my external IP address to discover my name (and then set an env var) on bootup.</p>
  <p>But if containers crash, my upgrade script won't have run, so updating Route 53 won't have happened.</p>
  <p>Is this problem already solved in some way? At this point, I'm looking at 2 or 3 days to implement a solution.</p>
  <p>I don't believe I can use Service Discovery, as SD uses the internal IP address and would be in foo.local, which isn't externally accessible.</p>
  <p>At this point, I think I have to write a program that determines what my DNS name needs to be and updates Route 53. That seems simple, but I also have to add permissions to update Route 53 to the IAM user inside the container, and that sounds like a security problem. I'd write a different program to expire dead names.</p>
  <p>Is there a better way? This doesn't seem like that unique a problem.</p>