Crates.io | aws-instance |
lib.rs | aws-instance |
version | 0.1.1 |
source | src |
created_at | 2022-10-24 02:13:14.306248 |
updated_at | 2022-10-24 02:13:14.306248 |
description | Create and SSH into AWS instances |
homepage | |
repository | |
max_upload_size | |
id | 695505 |
size | 89,249 |
Command-line program to manage AWS instances.
You can use this to create new AWS instances, start them, stop them, list the instances you have, and SSH into them.
Type aws-instance -h
or aws-instance <command> -h
Similarly to AWS profiles, aws-instance
has a config file (~/.aws-instance/config
) which contains defaults you can specify
by profile name. If you don't specify a profile name on the command line, it will look for a profile named
default
; barring that, it will use the application defaults.
Example of a config file:
[default]
keypair = default_keypair
security-groups = sg-2ac23f43
key = /home/jack/.ssh/default_keypair.pem
[work]
keypair = work_keypair
security-groups = sg-2ac23f43
key = /home/jack/.ssh/work_keypair.pem
The terraform directory contains Terraform code to provision some things, like the instance profiles,
security groups, etc. It also sets up access to the S3 bucket for the S3 package repo.
Note that it uses remote state from that repository, so you'll need to terraform apply
in that repo first.
I use Ansible to provision my instances. Once they're up and accepting SSH (which you can check with either
aws-instance ssh <hostname>
or by using ansible directly by doing ansible <hostname> -m ping
), you can use ansible to provision the
instance as whatever type you want, using the playbooks in the ansible
directory.
You can use aws-instance
for your ansible inventory by using the bin/ansible-inventory
script in this repo. Just add inventory=/path/to/ansible-inventory
to your .ansible.cfg
file.