awssh 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -17
- data/lib/awssh/config.rb +3 -3
- data/lib/awssh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f90f8db1821a009c13349a1a086a96e5200c2b
|
4
|
+
data.tar.gz: 49a74acf53fe5c80bfaa7baebe961887a6cf32a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366decc391cad6e35c85976ab31cabf97d6c15f4470e6d6f4ee72d3c43ed00380c26c471dde71a3a7727e9b17a7a5af505f40b0c6de87c7183efbcd1063c814b
|
7
|
+
data.tar.gz: fba8f18db93c5e602a6960f436ec466fe0c0645238e23132be683dec7049408065494e2a67d2d19149f07d17489c845876cf73389dd8a53238cf198bb2b7c656
|
data/README.md
CHANGED
@@ -17,9 +17,10 @@ Initialize the config file:
|
|
17
17
|
|
18
18
|
$ awssh -i
|
19
19
|
|
20
|
-
Edit the config file and add the AWS key and secret.
|
20
|
+
Edit the config file and add the AWS region, key, and secret.
|
21
21
|
```
|
22
22
|
...
|
23
|
+
region: us-east-1 # AWS region
|
23
24
|
key: AWS ACCESS KEY ID # AWS key
|
24
25
|
secret: AWS SECRET ACCESS KEY # AWS secret
|
25
26
|
...
|
@@ -27,12 +28,21 @@ secret: AWS SECRET ACCESS KEY # AWS secret
|
|
27
28
|
|
28
29
|
## Requirement
|
29
30
|
|
30
|
-
|
31
|
+
### Use Names = False
|
32
|
+
|
33
|
+
With `use_names: false` in the config, the tool will use the private address of the
|
34
|
+
server, expecting that the servers are in a vpc and that you are able to connect
|
35
|
+
to them directly (with VPN).
|
36
|
+
|
37
|
+
### Use Names = True
|
38
|
+
|
39
|
+
If `use_names: true`, then the only requirement of the tool is that the Name tag
|
40
|
+
on the instance maps to the DNS record.
|
31
41
|
Generally, `awssh` expects that if the name of the instance is `foo.bar`, then it can
|
32
42
|
connect to the server by appending the domain name as `foo.bar.example.com`.
|
33
43
|
|
34
44
|
If you unset the domain name in the config, it will not append it. As such, if your Name
|
35
|
-
tag maps directly to the
|
45
|
+
tag maps directly to the FQDN, it will work as well.
|
36
46
|
|
37
47
|
In the future, I might add a templated way for handling hostnames, to allow for
|
38
48
|
more customization in DNS lookup.
|
@@ -50,8 +60,10 @@ Search Terms:
|
|
50
60
|
name !~ /term/
|
51
61
|
|
52
62
|
Options:
|
63
|
+
-c, --config override config file (default: ~/.awssh)
|
53
64
|
-V, --version print version
|
54
|
-
-i, --
|
65
|
+
-i, --identity=IDENTITY set ssh key
|
66
|
+
--init initialize config
|
55
67
|
|
56
68
|
-l, --list just list servers
|
57
69
|
-n, --test just output ssh command
|
@@ -61,9 +73,7 @@ Options:
|
|
61
73
|
--no-cache disable cache for this run
|
62
74
|
|
63
75
|
-m, --[no-]multi connect to multiple servers
|
64
|
-
-
|
65
|
-
-u, --user override user setting
|
66
|
-
|
76
|
+
-u, --user USER override user setting
|
67
77
|
```
|
68
78
|
## Examples
|
69
79
|
Given a list of servers:
|
@@ -96,15 +106,20 @@ awssh -m production ^app3 #=> web1.production, web2.production, app1.production,
|
|
96
106
|
## Config
|
97
107
|
```
|
98
108
|
---
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
109
|
+
region: us-east-1 # AWS Region
|
110
|
+
key: AWS_ACCESS_KEY_ID # AWS access key id
|
111
|
+
secret: AWS_SECRET_ACCESS_KEY # AWS secret access key
|
112
|
+
multi: csshX # command to use when connecting to multiple servers
|
113
|
+
single: ssh # command to use when connecting to single server
|
114
|
+
#user: username # set user for connection to all servers
|
115
|
+
# this can be overridden on the command line
|
116
|
+
domain: example.com # if 'use_names' is set, this will be appended
|
117
|
+
# to names, leave blank if name is fully-qualified
|
118
|
+
use_names: false # if true, rather than connecting to IP's,
|
119
|
+
# connection strings will be created using Name
|
120
|
+
# tag and domain
|
121
|
+
cache: ~/.awssh.cache # the cache file, set to false to disable caching
|
122
|
+
expires: 86400 # cache expiration time in seconds
|
108
123
|
```
|
109
124
|
|
110
125
|
## Multi SSH
|
@@ -121,7 +136,6 @@ for more advanced usage.
|
|
121
136
|
## Caching
|
122
137
|
|
123
138
|
Maintains a simple cache with expiration (default: 1 day).
|
124
|
-
The cache just contains the list of servers' names.
|
125
139
|
You can disable the cache by setting the cache value to false in the config file.
|
126
140
|
|
127
141
|
## Shell Alias
|
data/lib/awssh/config.rb
CHANGED
@@ -17,9 +17,9 @@ module Awssh
|
|
17
17
|
attr_reader :data
|
18
18
|
|
19
19
|
def initialize(file)
|
20
|
-
@file = file
|
21
|
-
|
22
|
-
@data = OpenStruct.new(
|
20
|
+
@file = File.expand_path(file)
|
21
|
+
yaml = File.exist?(@file) ? YAML.load_file(file) : {}
|
22
|
+
@data = OpenStruct.new(yaml)
|
23
23
|
end
|
24
24
|
|
25
25
|
DEFAULT = <<-EOF
|
data/lib/awssh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Catanzarite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|