Contexto
The Contexto gem gives you information about the current state of ECS resources and more specifically the internal IP address of specific containers.
Installation
Install via the command line.
$ gem install contexto
Usage
Run the binary to connect to a container in a specific cluster and service.
$ contexto
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
** Contexto Contextualizes **
Clusters :
1. production
2. sandbox
3. nah
Please choose a cluster? 1
Services :
1. backend-app
2. starter-site
3. backend-authn
4. logspout
5. wombat
6. nah
Please choose a service? 1
Containers
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Container ┃ Status ┃ IP ┃
┣━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━┫
┃ sidekiq ┃ RUNNING ┃ 10.1.2.25 ┃
┣━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━┫
┃ app ┃ RUNNING ┃ 10.1.2.25 ┃
┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┛
Containers :
1. sidekiq
2. app
3. nah
Please choose a container? 1
Do you want to connect to container sidekiq? :
1. console
2. bash
3. ssh
4. nah
Please choose a connection type?
You can get Contexto to connect via SSH to a Bash shell, or a Rails console. If you're using SSH you'll need to add a key allowing access to the specific ECS hosts. This is usually the key used when you created the cluster.
You can also specify a cluster and service to take a shortcut to a specific set of containers.
$ contexto -c production -s backend-app
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/EmpaticoOrg/contexto. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.