awful 0.0.174 → 0.0.175

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: 6f7761e2b6a9222e092a65157fc986f451228822
4
- data.tar.gz: b04a5adbbabc50bbe3d84b0b78148585d28d5255
3
+ metadata.gz: b80eab41f82cb2d3d90753811d0336912dea2027
4
+ data.tar.gz: 6cdcb78291ac310ebc2a0ba7f9ea50b13288ca6f
5
5
  SHA512:
6
- metadata.gz: e7dd7b3696bd83ae497ca9b4c960ab49da92d7fc7a889be76caaa6d06c4d44534fa74c976d3c86ace5b4186aa3fb96a3b312edab833f1acd0f19cafe39ea5911
7
- data.tar.gz: 2efeddbe73e96d82d2a83fa878aa6c2d75eada26d20385704ce67c013dc18a28316c01b81436ae6a8f970c3ce05207b968abd68ef685b21af334990dbfe1aec7
6
+ metadata.gz: fcb1096da24fa34c27ca6c090919118c555f7d9a70fafcef35ea678202cf3767c25af8030604c4eae6c327d29ac555649b6f2af5662851667a5187b73ffd58e5
7
+ data.tar.gz: 8f97ce30eacfa8429a0814008b7f0cbeea615f1761538e9260c022a2958816ec7f0c14849268c5e120905a2fe2ff9bbd5d8450a2f85bd9c90e3a3d3a05170993
data/bin/acm CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/alb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ami CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/apigw CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/asg CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/asgn CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/certs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/cf CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/cloudfront CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/cwevents CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/cwlogs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/dp CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/dyn CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ec2 CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ecr CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ecs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/eip CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/elasticache CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/elb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/iam CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/keypair CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/kms CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/lambda CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/lc CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/param CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/r53 CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/rds CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/route CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/s3 CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/sg CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/sqs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ssm CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/sts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/subnet CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/ta CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/vpc CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/bin/waf CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #-*- mode: ruby; -*-
3
3
 
4
4
  require 'awful'
data/lib/awful.rb CHANGED
@@ -104,7 +104,7 @@ module Awful
104
104
  end
105
105
  end
106
106
 
107
- ## returns contents of named file, or stdin if file = nil
107
+ ## returns contents of named file, or stdin if file = nil, or false if no stdin
108
108
  def file_or_stdin(file)
109
109
  (file and File.read(file)) || ((not $stdin.tty?) and $stdin.read)
110
110
  end
@@ -183,9 +183,14 @@ module Awful
183
183
  end
184
184
 
185
185
  desc 'events NAME', 'show events for stack with name NAME'
186
+ method_option :number, aliases: '-n', type: :numeric, default: nil, desc: 'return n most recent events'
186
187
  def events(name)
187
- cf.describe_stack_events(stack_name: name).stack_events.output do |events|
188
- print_table events.map { |e| [e.timestamp, color(e.resource_status), e.resource_type, e.logical_resource_id, e.resource_status_reason] }
188
+ events = cf.describe_stack_events(stack_name: name).stack_events
189
+ events = events.first(options[:number]) if options[:number]
190
+ events.reverse.output do |events|
191
+ print_table events.map { |e|
192
+ [e.timestamp, color(e.resource_status), e.resource_type, e.logical_resource_id, e.resource_status_reason]
193
+ }
189
194
  end
190
195
  end
191
196
 
data/lib/awful/sts.rb CHANGED
@@ -13,13 +13,20 @@ module Awful
13
13
  end
14
14
 
15
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'
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
+ method_option :env, aliases: '-e', type: :boolean, default: false, desc: 'output as env vars to eval'
18
19
  def assume_role(arn, name)
19
20
  opts = only_keys_matching(symbolize_keys(options), %i[duration_seconds policy])
20
21
  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))
22
+ sts.assume_role(params).output do |session|
23
+ if options[:env]
24
+ puts %i[access_key_id secret_access_key session_token].map { |var|
25
+ "export AWS_#{var.upcase}=#{session.credentials.send(var)}"
26
+ }
27
+ else
28
+ puts YAML.dump(stringify_keys(session.to_hash))
29
+ end
23
30
  end
24
31
  end
25
32
  end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.174'
2
+ VERSION = '0.0.175'
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.174
4
+ version: 0.0.175
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-02 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler