A faster way to open a ssh connection to an OpsWorks instance
$ npm install yaowst -g
$ yaowst
YaOWsT run the first time
Creating the config file and backup the existing OpenSSH config file
YaOWsT init complete, now you can edit the config file "~/.yaowst"
$ yaowst --help
Yet another OpsWorks ssh Tool
Usage: yaowst [options]
options
-c, --config-file The location of the YaOWsT config file
-o, --ssh-config-file The location of the OpenSSH config file
-s, --save-mode 24/7 or all, 24/7 store no instances that started by auto scaling
$ yaowst
Get running OpsWorks instances and store the hosts to the OpenSSH config file
The OpenSSH config file successful updated
4 Entries updated (instances and base config)
$ ssh opsworks_one_1
$ scp example.txt opsworks_one_1:/tmp/
{
"sshOptions": {
"StrictHostKeyChecking": "no",
"UserKnownHostsFile": "~/.ssh/opsworks_known_hosts",
"IdentitiesOnly": "yes",
"User": "yaowst"
},
"opsWorks": {
"accessKeyId": "MAIN_KEY",
"secretAccessKey": "MAIN_SECRET",
"region": "OPSWORKS_REGION"
},
"stacks": [
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"sshOptions": {
"IdentityFile": "~/.ssh/opsworks_yaowst.pem"
}
},
{
"sshOptions": {
"IdentityFile": "~/.ssh/opsworks_yaowst_1.pem"
},
"layers": [
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"alias": "opsworks_one-"
},
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"alias": "opsworks_two-"
}
]
},
{
"accessKeyId": "ANOTHER_KEY",
"secretAccessKey": "ANOTHER_SECRET",
"sshOptions": {
"IdentityFile": "~/.ssh/opsworks_yaowst_2.pem"
},
"layers": [
{
"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"alias": "opsworks_three-"
}
]
}
]
}
After the first run, YaOWsT create a config file with basic settings.
The location is ~/.yaowst
and has the permission 0600
.
{
"opsWorks": {
"region": "us-east-1"
},
"sshOptions": {
"StrictHostKeyChecking": "no",
"UserKnownHostsFile": "/dev/null",
"IdentitiesOnly": "yes"
},
"stacks": []
}
{
"opsWorks": {
"accessKeyId": "<Access Key ID>",
"secretAccessKey": "<Secret Access Key>",
"region": "<OpsWorks Region>"
},
"sshConfigFile": {
"file": null,
"saveMode": "24/7"
},
"sshOptions": {
"StrictHostKeyChecking": "no",
"UserKnownHostsFile": "/dev/null",
"IdentitiesOnly": "yes"
},
"stacks": [
{
"id": "<OpsWorks Stack ID>",
"accessKeyId": "<Access Key ID>",
"secretAccessKey": "<Secret Access Key>",
"region": "<OpsWorks Region>",
"prefix": "aws-",
"sshOptions": {},
"layers": [
{
"id": "<OpsWorks Layer ID>",
"alias": "layer-1-",
"prefix": "aws-layer-1-",
"sshOptions": {}
}
]
}
]
}
{object} opsWorks
the default IAM credentials for all stacks{string} accessKeyId
the access key id{string} secretAccessKey
the secret access key{string} region
the default OpsWork region
{object} sshConfigFile
OpenSSH config file settings{string|null} file
ifnull
then YaOWsT use~/.ssh/config
as OpenSSH config file else YaOWsT use this path{string} saveMode
24/7
orall
,24/7
store only instances that run 24/7 (no time- or load-based instances)
{object} sshOptions
see the OpenSSH client config manual{object[]} stacks
this array has all stacks{string} id
the OpsWorks Stack ID, if you use the layers option then you can skip this option{string} [accessKeyId]
overwrite the default access key id{string} [secretAccessKey]
overwrite the default secret access key{string} [region]
overwrite the default OpsWorks region{string} [prefix]
add this prefix to all instances in this stack, only if the layer as no alias{object} [sshOptions]
overwrite existing options and merge the another options{object} [layers]
if this option not exists then YaOWsT check all instances in this stack{string} id
the OpsWorks layer ID{string} [alias]
if the instance name has numbers then YaOWsT replace eventing before the number, if the instance name has no number then the alias value will added as prefix to the instance name{string} [prefix]
add this prefix to all instances in this stack, only if the layer as no alias{object} [sshOptions]
overwrite existing options and merge the another options
options
{string} configFile
The location of the YaOWsT config file{object} sshConfigFile
{string} file
The location of the OpenSSH config file{string} saveMode
24/7
orall
,24/7
store only instances that run 24/7
Create the YaOWsT config file and backup the existing OpenSSH config file
option
{boolean} force
overwrite the YaOWsT config file
Store the instances in the OpenSSH config file
option
{string} saveMode
24/7
orall
,24/7
store no instances that started by auto scaling
The tests are with and without AWS API request, per default the tests are without API requests.
For the Tests with API Requests you must create as new OpsWorks Stack and copy some files.
The Stack structure
- The Stack need 2 Layers
- in the first Layer one instance is online
- in the second Layer two instances are online
Copy Files and add your IAM credentials and Ids, the files are in resources/test/
configOpsWorksLayer.json.default
->configOpsWorksLayer.json
configOpsWorksStack.json.default
->configOpsWorksStack.json
configYaowst.json.default
->configYaowst.json
npm test
Run tests for all relevant versions of io.js/node.js
$ git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
$ echo "source ~/.nvm/nvm.sh" >> ~/.bashrc
$ nvm install 0.10
$ nvm install 0.12
$ nvm install 4
$ nvm install 6
./resources/tools/cross-test.sh
For the cross os tests you can use vagrant-yaowst
If you uninstall yaowst then you must also delete the yaowst section form the ssh config file, everything between ## yaowst begin ##
and ## yaowst end ##