This project is used to manage DNS records for AWS Load Balancers.
The application periodically checks the state of AWS Load Balancers and updates the DNS records in Route53 accordingly. It uses the AWS SDK for Go to interact with AWS services.
It does the following:
- Authenticates with AWS and creates a service client.
- Retrieves a list of all load balancers.
- Retrieves the ID of the Route53 hosted zone specified by the command line options.
- Retrieves a list of all resource record sets in the hosted zone.
- Adds DNS records for the load balancers that don't already have records.
- Cleans up DNS records for load balancers that no longer exist.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Go 1.16 or later
- AWS account with access to manage Load Balancers and Route53
- Clone the repository to your local machine.
- Navigate to the project directory.
- Run
go build
to compile the project.
You can run the program with command line arguments to specify the AWS region, Route53 hosted zone, check interval, and the tag to use for the DNS record.
Here's an example:
./aws_lb_dns -region us-west-2 -zone example.com -interval 5m -tag Name