Skip to content

Small utility to update a Route53 record set with a dynamic IP address

License

Notifications You must be signed in to change notification settings

fsaravia/route-53-updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Route 53 record updater

Go Report Card

What?

This is a small tool that updates a record in AWS Route53 with a dynamic IP address.

It works on two stages:

Resolve local IP address

In order to resolve the local IP address, this tool requires an external service that accepts a GET request and returns a JSON response in the following form:

{
	"ip": "127.0.0.1"
}

An example for the code of such a service can be found here

Update IP address on Route53

Once the local IP address has been obtained, it calls Route53 and updates an A record with the value of said IP address.

Configuration

This tool depends entirely on environment variables, if unset or empty, it will fail.

  • RESOLVER_URL: The URL of the IP resolver to which a GET request will be sent.
  • API_KEY: The API key of the URL resolver. This API key will be sent as a header under the value x-api-key, following the AWS Lambda conventions.
  • HOSTED_ZONE_ID: The ID of the AWS Route53 hosted zone.
  • RECORD_SET: The FQDN of the record set to update.

Usage:

RESOLVER_URL='<AN_URL>' \
API_KEY='<AN_API_KEY>' \
HOSTED_ZONE_ID='<YOUR_ZONE_ID>' \
RECORD_SET='<YOUR_RECORD_SET>' \
go run ./main.go

Example:

RESOLVER_URL='https://resolver.example.org/whatsmyip' \
API_KEY='123456' \
HOSTED_ZONE_ID='FOO' \
RECORD_SET='dynamic.example.org' \
go run ./main.go

About

Small utility to update a Route53 record set with a dynamic IP address

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages