awful 0.0.91 → 0.0.92
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sts +7 -0
- data/lib/awful/sts.rb +26 -0
- data/lib/awful/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed930ce269fe2d52ba73c05a5d52fc2cda049cee
|
4
|
+
data.tar.gz: 76bcd01d7ce84732718a6df019199fd0301d839b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 616f408bf53510e71346e42bb0ef86d9b220b1a7cabc3ba62764ae5dd4271124ad7ea3e13ab786a8f3d284cd39e715aaa2205a2d815a4dd8a786ca8c47d14c34
|
7
|
+
data.tar.gz: 7b5947b235087111ee4981135f3e8a7dcf62a4a3c5ef1ba856a0bf041183be942e1b6cb204df32a0b4e74f95bdeeb31fe0833a92ffbfde9e06937067eb86b48a
|
data/bin/sts
ADDED
data/lib/awful/sts.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Awful
|
2
|
+
module Short
|
3
|
+
def sts(*args)
|
4
|
+
Awful::Sts.new.invoke(*args)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class Sts < Cli
|
9
|
+
no_commands do
|
10
|
+
def sts
|
11
|
+
@sts ||= Aws::STS::Client.new
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'assume_role ARN NAME', 'Return credentials for given role'
|
16
|
+
method_option :duration_seconds, aliases: '-d', type: :numeric, default: nil, desc: 'Duration of session in sec'
|
17
|
+
method_option :policy, aliases: '-p', type: :string, default: nil, desc: 'Access policy as JSON string'
|
18
|
+
def assume_role(arn, name)
|
19
|
+
opts = only_keys_matching(symbolize_keys(options), %i[duration_seconds policy])
|
20
|
+
params = { role_arn: arn, role_session_name: name }.merge(opts)
|
21
|
+
sts.assume_role(params).tap do |session|
|
22
|
+
puts YAML.dump(stringify_keys(session.to_hash))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.92
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,7 @@ executables:
|
|
103
103
|
- s3
|
104
104
|
- sg
|
105
105
|
- ssm
|
106
|
+
- sts
|
106
107
|
- subnet
|
107
108
|
- ta
|
108
109
|
- vpc
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- bin/s3
|
135
136
|
- bin/sg
|
136
137
|
- bin/ssm
|
138
|
+
- bin/sts
|
137
139
|
- bin/subnet
|
138
140
|
- bin/ta
|
139
141
|
- bin/vpc
|
@@ -159,6 +161,7 @@ files:
|
|
159
161
|
- lib/awful/s3.rb
|
160
162
|
- lib/awful/security_group.rb
|
161
163
|
- lib/awful/ssm.rb
|
164
|
+
- lib/awful/sts.rb
|
162
165
|
- lib/awful/subnet.rb
|
163
166
|
- lib/awful/trusted_advisor.rb
|
164
167
|
- lib/awful/version.rb
|