Live data from Hacker News

Dynamic Route53 records for AWS auto scaling groups with Terraform

underthehood.meltwater.com

1–10 of 37 posts

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#3
This is a pretty sweet Terraform module that I will personally be testing out soon.

I was curious what they are using for the Lambda function, and it turns out is a framework-less Python script[0].

One thing I'm not clear on yet is if using this will imply one such lambda for every autoscaling group or not.

[0] https://github.com/meltwater/terraform-aws-asg-dns-handler/b...

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#4

This is a pretty sweet Terraform module that I will personally be testing out soon. I was curious what they are using for the Lambda function, and it turns out is a framework-less Python script[0]. One thing I'm not clear on yet is if using this will imply one such lambda for every autoscaling group or not. [0] https://github.com/meltwater/terraform-aws-asg-dns-handler/b...

Great to hear! Please let us know how the testing goes!

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#5
post #2

I think AWS not having automatic hostnames for ASG instances is a way to lure you into Lambda's, at least that's how I got hooked.

Or a way to get you more familiar with tagging, or the various queries and filters on different api results. It's annoying at first, but it leads to less reliance on the console and more effective scripting. (Instead of naming my instances I just made a script which looks up the instance I want and outputs the IP and username, and put that in an SSH config)

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#6
post #2

I think AWS not having automatic hostnames for ASG instances is a way to lure you into Lambda's, at least that's how I got hooked.

Why should an instance created by an ASG have a host name? These are cattle not pets. I use Serilog for logging with an EC2 enricher that automatically adds the instance Id and the IP address.

Since Serilog does structured logging, I can use either an ElasticSearch or Mongo sink and do complex queries.

If I routinely need to log into an instance to troubleshoot, I need to be capturing data and sending it to a central logging system.

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#8
post #2

I think AWS not having automatic hostnames for ASG instances is a way to lure you into Lambda's, at least that's how I got hooked.

Why should an instance created by an ASG have a host name? These are cattle not pets. I use Serilog for logging with an EC2 enricher that automatically adds the instance Id and the IP address. Since Serilog does structured logging, I can use either an ElasticSearch or Mongo sink and do complex queries. If I routinely need to log into an instance to troubleshoot, I need to be capturing data and sending it to a central…

> Why should an instance created by an ASG have a host name?

It means you can connect to it by just knowing its instance ID.

Adding the IP address everywhere also works.

There can be some nice SSH config options though, like using a particular key for everything *.prod.myaws.com

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#9

Earlier quoted context omitted.

Why should an instance created by an ASG have a host name? These are cattle not pets. I use Serilog for logging with an EC2 enricher that automatically adds the instance Id and the IP address. Since Serilog does structured logging, I can use either an ElasticSearch or Mongo sink and do complex queries. If I routinely need to log into an instance to troubleshoot, I need to be capturing data and sending it to a central…

> Why should an instance created by an ASG have a host name? It means you can connect to it by just knowing its instance ID. Adding the IP address everywhere also works. There can be some nice SSH config options though, like using a particular key for everything *.prod.myaws.com

Yes exactly, SSH access is also one of the reasons for building the module, that is mentioned in the blog post.

> Access: When troubleshooting, we save time not having to look up the instance’s internal IP address for SSH access.

Re: Dynamic Route53 records for AWS auto scaling groups with Terraform

#10

Earlier quoted context omitted.

Why should an instance created by an ASG have a host name? These are cattle not pets. I use Serilog for logging with an EC2 enricher that automatically adds the instance Id and the IP address. Since Serilog does structured logging, I can use either an ElasticSearch or Mongo sink and do complex queries. If I routinely need to log into an instance to troubleshoot, I need to be capturing data and sending it to a central…

> Why should an instance created by an ASG have a host name? It means you can connect to it by just knowing its instance ID. Adding the IP address everywhere also works. There can be some nice SSH config options though, like using a particular key for everything *.prod.myaws.com

That’s the second part. If I’m troubleshooting by logging into EC2 instances, there is something wrong with my logging infrastructure. That’s actually the larger issue.
Post reply on HN