awful 0.0.151 → 0.0.152

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: 09e134acfc0ca9ffd1370d276c4c4f4c5922e5a6
4
- data.tar.gz: e483d1d9a3ab0cd647a3b7c3e4046c0832f54631
3
+ metadata.gz: 7e9cf294dcdf1b576e46d1737c8a8d209b317208
4
+ data.tar.gz: 76d39a1f0288bbc5727ba0d481d707d633ee44c4
5
5
  SHA512:
6
- metadata.gz: 0e445e45d3befb844af4a7c9d223371410d1fe684c7cff9a97b77c243a5d993e45f86457d653cb998ad3f009ebad289e3566241656bb491a64aae57b2a202520
7
- data.tar.gz: e35f95e8ead07d40874f24ed4b8915ab00b107e56ad6c5d74371c38610d56b87104742c1aad6504ae11032046546eb1ddccc877a137c83cc2db7b2199056b2e8
6
+ metadata.gz: c88e205ba51cb5365e1224e8ab73b6a0893702c60720821ff346a77dc440acc0193eaf2e688c25894196d2f3b7b6bd26ea7a0b37465168911efd0c2e2ff3a2a6
7
+ data.tar.gz: 1c0e24efd8f3787b345233bb9f7d725e51a893626812d719029e514b9433e5bf4afb2f70e11106fdaa631d3bcbb98c905b14fe1f9d69ae18ddf125ee72e102eb
@@ -77,9 +77,9 @@ module Awful
77
77
  end
78
78
  end
79
79
 
80
- desc 'tags NAME', 'dump tags on all ELBs matching NAME (up to 20)'
81
- def tags(name)
82
- elb.describe_tags(load_balancer_names: all_matching_elbs(name).map(&:load_balancer_name)).tag_descriptions.output do |tags|
80
+ desc 'tags NAMES', 'dump tags for ELBs'
81
+ def tags(*names)
82
+ elb.describe_tags(load_balancer_names: names).tag_descriptions.output do |tags|
83
83
  tags.each do |tag|
84
84
  puts YAML.dump(stringify_keys(tag.to_hash))
85
85
  end
@@ -1,3 +1,5 @@
1
+ require 'base64'
2
+
1
3
  module Awful
2
4
  module Short
3
5
  def kms(*args)
@@ -92,5 +94,17 @@ module Awful
92
94
  end
93
95
  end
94
96
 
97
+ desc 'encrypt ID', 'encrypt data using KMS key'
98
+ def encrypt(id, data)
99
+ blob = kms.encrypt(key_id: id, plaintext: data).ciphertext_blob
100
+ puts Base64.encode64(blob)
101
+ end
102
+
103
+ desc 'decrypt', 'decrypt'
104
+ def decrypt(data)
105
+ key = Base64.decode64(data)
106
+ puts kms.decrypt(ciphertext_blob: key)
107
+ end
108
+
95
109
  end
96
110
  end
@@ -137,6 +137,19 @@ module Awful
137
137
  )
138
138
  end
139
139
 
140
+ desc 'copy BUCKET OBJECT', 'copy object from source bucket/object'
141
+ method_option :source, aliases: '-s', type: :string, default: nil, desc: 'source as bucket/object'
142
+ method_option :kms, aliases: '-k', type: :string, default: nil, desc: 'KMS key ID for encryption'
143
+ def copy(bucket, key)
144
+ s3.copy_object(
145
+ bucket: bucket,
146
+ key: key,
147
+ server_side_encryption: options[:kms] ? 'aws:kms' : nil,
148
+ ssekms_key_id: options[:kms],
149
+ copy_source: options[:source],
150
+ )
151
+ end
152
+
140
153
  desc 'remove_bucket NAME', 'delete a bucket, which must be empty'
141
154
  def remove_bucket(name)
142
155
  if yes? "Really delete bucket #{name}?", :yellow
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.151'
2
+ VERSION = '0.0.152'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.151
4
+ version: 0.0.152
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister