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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b35c1d7777dbebf7e48b483c96d101895dfb5f4f
4
- data.tar.gz: d3b0aae16536d6b1a3c0c30129bfa83a25b610af
3
+ metadata.gz: ed930ce269fe2d52ba73c05a5d52fc2cda049cee
4
+ data.tar.gz: 76bcd01d7ce84732718a6df019199fd0301d839b
5
5
  SHA512:
6
- metadata.gz: 4711cbaa6805ee0ce2769473aa38911b86604f865fd88631975fb4569a775db09ef64f088eedfe3b9fe842063643c65c36bd1992d7c5cbec96f8c13b9c8e8634
7
- data.tar.gz: db03233ff6c30a647f3a1faea4d4d179fcdf4115c38308eb8f1f21baf0a2933679f714245cd84492d3e1336bc83561a36178d42a0129002f3910d14e1f66cd84
6
+ metadata.gz: 616f408bf53510e71346e42bb0ef86d9b220b1a7cabc3ba62764ae5dd4271124ad7ea3e13ab786a8f3d284cd39e715aaa2205a2d815a4dd8a786ca8c47d14c34
7
+ data.tar.gz: 7b5947b235087111ee4981135f3e8a7dcf62a4a3c5ef1ba856a0bf041183be942e1b6cb204df32a0b4e74f95bdeeb31fe0833a92ffbfde9e06937067eb86b48a
data/bin/sts ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ #-*- mode: ruby; -*-
3
+
4
+ require 'awful'
5
+ require 'awful/sts'
6
+
7
+ Awful::Sts.start(ARGV)
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
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.91'
2
+ VERSION = '0.0.92'
3
3
  end
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.91
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-23 00:00:00.000000000 Z
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