Skip to content

iphousehq/aws-cli

Repository files navigation

AWS Command Line Interface complement

CLI utility designed to complement the official aws cli.

comsec-aws.exe leverages the AWS SDK and the instance meta-data to set A records on Route 53.

Executing this tool when an EC2 instance starts gives you a DynDNS ersatz!

Configuration:

By default comsec-aws.exe will rely on the instance having been launched with an IAM role that allows access to R53.

If you have the official aws cli installed, you can create a profile of credentials
(run aws configure --profile [name] from the command line, then use the --profile [name] parameter).

Usage:

comsec-aws.exe [options]

Options:

r53 list zones
r53 list zone [zone]
r53 set [subdomain] [--ip [ip]|--publicIp|--localIp]] [--ttl [ttl]]

Optional switches

--profile [name]
--profiles-location [pathToConfigFile]
--region [region]

Examples

  • List all hosted zones: comsec-aws r53 list zones

  • List all records in the given zone: comsec-aws r53 list AABBCCDDEE

  • List all records in the given zone with a named profile and region: comsec-aws r53 list AABBCCDDEE --profile blah --profile-location "~\.aws\config" --region eu-west-1

All examples below create a record or edit a matching one.

  • Set record to a given IP address: comsec-aws r53 set sub.domain.com --ip 10.1.2.3
  • Set record to the instance's public IP and also specify the TTL value: comsec-aws r53 set sub.domain.com --publicIp --ttl 300
  • Set record to local IP: comsec-aws r53 set internal.sub.domain.com --localIp --ttl 300
  • Update the TTL of an existing record: comsec-aws r53 set internal.sub.domain.com --ttl 60

Download & Install:

  1. Find the latest release.
  2. Extract the zip in a folder.
  3. Run the command from the command line prompt.

Notes

  1. http://169.254.169.254/latest/meta-data/public-ipv4 is used to obtain the public IP address of the instance it runs on. EC2 classic and VPC instances are supported (VPC instances must be assigned a public or elastic IP at launch time).
  2. http://169.254.169.254/latest/meta-data/local-ipv4 is used to optain the private IP address of the instance.
  3. It only creates or updates A (IPv4) records.

License

This project is licensed under the terms of the MIT license.

By submitting a pull request for this project, you agree to license your contribution under the MIT license to this project.

About

Amazon Web Services Command Line Interface

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages