Download the PHP package fruux/ec2dns without Composer
On this page you can find all versions of the php package fruux/ec2dns. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ec2dns
ec2dns
ec2dns is a set of command line tools that makes it easy to resolve public hostnames of EC2 instances and ssh into them via their tag name.
Usage of ec2dns
ec2dns provides DNS resolution of ec2 tag names under the ".ec2" TLD. If a servers tag name is appserver-1
, it can be resolved as appserver-1.ec2
.
ec2dns allows working with ec2 tag names like with normal domain names as shown in the following examples.
ssh
scp
mysql
ec2dns tools
ec2dns also includes wrappers around ssh and scp (if you can't or don't want to set up the DNS feature on your machine), as well as a tool to lookup hostnames and a tool to update your /etc/hosts file.
You won't need these wrapper tools if you have set up the DNS feature as shown in the installation instructions below.
ec2host
Get a list of ec2 instances
Get the hostname of an ec2 instance by its name tag
combine ec2host with other commands by using backticks
ec2ssh
ssh into an instance via its name tag
ssh into an instance via its name tag and execute commands
ec2scp
copy a file from an ec2 instance onto your machine
ec2updatehostsfile
update /etc/hosts with your ec2 instances
Your machine is now able to resolve your ec2 instances by tags directly, so for example the following will just work
Prerequisites
- Obviously an AWS account and at least one running EC2 instance.
- Correctly set
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables. - You need Composer to install the dependencies - you should install it globally, as described here.
- You should have a
~/bin
directory and it should be included in yourPATH
environment variable.
Installation
Basic
-
The following command installs ec2dns via Composer.
- Make sure you have
~/.composer/vendor/bin/
in your path.
DNS feature
These instructions are for OS X.
-
Add the configuration for the DNS resolver by creating the file
/etc/resolver/ec2
and pasting the following content. -
Create the LaunchAgent configuration that starts the DNS server by creating the file
~/Library/LaunchAgents/com.fruux.ec2dns.plist
with the following command. If you are using ZSH, you'll have to change/bin/bash
to/bin/zsh
. - Finally activate the LaunchAgent config by pasting the following into the terminal.
Updating
Contributing
Please submit all pull requests against the master branch. Code accompanied with phpunit tests is highly appreciated. Thanks!
Acknowledgements
ec2dns is inspired by ec2-ssh and powered by aws/aws-sdk-php.
Copyright and license
Copyright (c) fruux GmbH. All rights reserved.
fruux is a free service that takes care of your contacts, calendars and more so you don't have to (powered by CardDAV and CalDAV).
Check the license.
All versions of ec2dns with dependencies
aws/aws-sdk-php Version ~2.8.0
hoa/dns Version ~3.0
hoa/socket Version ~1.0