Skip to content

Commit

Permalink
Add readme and migrate to alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
vincetse committed Apr 26, 2016
2 parents 9d84b90 + a161b9f commit 76b8dec
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM stackbrew/ubuntu:16.04
MAINTAINER Oliver Soell "oliver@timelinelabs.com"
FROM alpine:3.3
MAINTAINER Vince Tse <thelazyenginerd@gmail.com>

RUN apt-get update -qq
RUN apt-get install -y python-boto python-requests
RUN apk update
RUN apk upgrade
RUN apk add py-boto py-requests

ADD bin/route53-presence /bin/route53-presence

Expand Down
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,65 @@
route53-presence
================
# vincetse/route53-presence

Docker container which registers the local ec2 instance into route53
Docker container which registers the local EC2 instance into Route53.

This is a fork of [timelinelabs/docker-route53-presence](https://github.com/timelinelabs/docker-route53-presence) which doesn't have a Docker Hub repo. I have updated the script so that it can handle hostnames with 3rd-level domains (i.e. host.subdomain.example.com). I have sent a [pull request](https://github.com/timelinelabs/docker-route53-presence/pull/1) to get the change incorporated, but decided to roll on my own given that repo hasn't been updated since March 2014.

```
docker run --rm timelinelabs/docker-route53-presence -h
usage: route53-presence [-h] [--ttl TTL] [--local] hostname
Register or unregister a name in Route53.
positional arguments:
hostname fqdn to manipulate
optional arguments:
-h, --help show this help message and exit
--ttl TTL ttl in seconds, default 600
--local use local IP instead of public
```

## Example Usage

```
# Passing AWS keys as environment variables
docker run --name route53-presence \
-e AWS_ACCESS_KEY=XXX \
-e AWS_SECRET_KEY=XXX \
vincetse/route53-presence \
--ttl=300 \
host.subdomain.example.com
# Omitting AWS keys if the EC2 instance has a role that allows Route 53 actions. See below.
docker run --name route53-presence \
vincetse/route53-presence \
--ttl=300 \
host.subdomain.example.com
```

## AWS IAM Role

The AWS credentials can be omitted if the host has a valid IAM role that allows for the following permissions:

```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:GetHostedZone",
"route53:ChangeResourceRecordSets"
],
"Resource": "arn:aws:route53:::hostedzone/<ZONEID>"
},
{
"Effect": "Allow",
"Action": [
"route53:ListHostedZones"
],
"Resource": "*"
}
]
}
```

0 comments on commit 76b8dec

Please sign in to comment.