Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cirocosta/auto53
Automatic Route53 updates based on EC2 Autoscaling state changes
https://github.com/cirocosta/auto53
autoscaling aws ec2 golang route53
Last synced: 24 days ago
JSON representation
Automatic Route53 updates based on EC2 Autoscaling state changes
- Host: GitHub
- URL: https://github.com/cirocosta/auto53
- Owner: cirocosta
- Created: 2017-07-08T15:10:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T18:01:08.000Z (almost 7 years ago)
- Last Synced: 2024-10-04T16:45:30.042Z (about 1 month ago)
- Topics: autoscaling, aws, ec2, golang, route53
- Language: Go
- Homepage:
- Size: 8.33 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
auto53 📂
The missing link between AWS AutoScaling Groups and Route53
[![Build Status](https://travis-ci.com/cirocosta/auto53.svg?token=ixZ9XiEPW4YH62ixq7Av&branch=master)](https://travis-ci.com/cirocosta/auto53)
### Overview
`auto53` solves the issue of keeping a route53 zone up to date with the changes that an autoscaling group might face.
For instance, consider the following state in EC2:
```yaml
# internal state retrieved from the
# inspection of EC2
autoscaling_groups:
- name: asg1
instances:
- id: 'i-0123'
private_ip: '10.0.0.2'
- id: 'i-0321'
private_ip: '10.0.0.3'
```and also the following formatting configuration:
```yaml
# for each zone we can tie several
# autoscaling groups that present
# an automatic record creation rule.
---
- AutoScalingGroup: 'asg1'
Zone':
ID: 'zone123'
Name: 'ciro-test'
Record: 'asg1-machines'- AutoScalingGroup: 'asg1'
Zone':
ID: 'zone123'
Name: 'ciro-test'
Record: '{{ .Id }}-machine'
```with that we'd end up with the following records:
```yaml
asg1-machines.ciro-test:
- 10.0.0.2
- 10.0.0.3i-0123-machine.ciro-test:
- 10.0.0.2i-0321-machine.ciro-test:
- 10.0.0.3
```Now we could consider the situation where `asg1` scales out to `3` instances while at the same time having the death of `i-0321`:
```diff
autoscaling_groups:
asg1:
machines:
- id: 'i-0123'
private_ip: '10.0.0.2'
- - id: 'i-0321'
- private_ip: '10.0.0.3'
+ - id: 'i-0444'
+ private_ip: '10.0.0.4'
+ - id: 'i-0555'
+ private_ip: '10.0.0.5'
```That would mean that `auto53` would notice the change in the desired state and then update `route53` accordingly:
```yaml
asg1-machines.ciro-test:
- 10.0.0.2
- 10.0.0.4
- 10.0.0.5i-0123-machine.ciro-test:
- 10.0.0.2i-0444-machine.ciro-test:
- 10.0.0.4i-0555-machine.ciro-test:
- 10.0.0.5
```### Usage
`auto53` aims at being a single binary that is capable of running in 2 modes:
- server mode: sits in an instance querying route53 state from time to time as well as being (optionally) notified by SNS in case of any changes in an autoscaling group;
- single execution mode: runs once whenever the binary is fired - suitable for executions in the context of a one-off lambda function.In either case, the necessary user permissions are needed:
- EC2 Describe Instances
- Route53 - ListResourceRecordSets, ChangeResourceRecordSetsThe AWS credentials are accessed via the default behavior of AWS CLI (either environment variables or config file under `~/.aws`).
```
Usage: auto53 [opts ...]Options:
--config CONFIG [default: ./auto53.yaml]
--debug activates debug-level logging
--dry run without performing modifications
--interval INTERVAL [default: 2m0s]
--listen
--once run one time and exit
--port PORT [default: 8080]
--help, -h display this help and exit
```