Docker container that performs DDNS synchronization against a DNS record registered with Amazon Route53.
- Docker environment with swarm enabled so we can make use of Docker secrets and Docker configs. Only one node is required in the cluster.
- A DNS record in an Amazon Route53 public hosted zone.
- Create a new IAM user and generate a set of access keys.
- Use this template to assign the required IAM permissions. Fill in the
hosted-zone-id
attach the IAM policy to your IAM user:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DdnsAccess",
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListResourceRecordSets"
],
"Resource": "arn:aws:route53:::hostedzone/[hosted-zone-id]"
}
]
}
-
Ensure you have the following configuration values on hand:
- AWS Access Key ID
- AWS Secret Access Key
- Hosted Zone ID associated with your domain
- Domain name you want to use
- TTL in seconds for the DNS record
- Interval in seconds to control update frequency
-
Execute
bash config-up
. The script will prompt you to enter the above items and generate docker secrets and docker configs.
- Execute
docker build -t route53-ddns .
to build the docker container. - To start the container as a service, execute
docker stack deploy --compose-file docker-compose.yml service
. - Inspect the logs by running
docker service logs service_route53-ddns
.
- Stop the service by running
docker service rm service_route53-ddns
- Optionally remove the secrets and configs by executing
bash config-down