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 +4 -4
- data/lib/awful/elb.rb +3 -3
- data/lib/awful/kms.rb +14 -0
- data/lib/awful/s3.rb +13 -0
- data/lib/awful/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e9cf294dcdf1b576e46d1737c8a8d209b317208
|
4
|
+
data.tar.gz: 76d39a1f0288bbc5727ba0d481d707d633ee44c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c88e205ba51cb5365e1224e8ab73b6a0893702c60720821ff346a77dc440acc0193eaf2e688c25894196d2f3b7b6bd26ea7a0b37465168911efd0c2e2ff3a2a6
|
7
|
+
data.tar.gz: 1c0e24efd8f3787b345233bb9f7d725e51a893626812d719029e514b9433e5bf4afb2f70e11106fdaa631d3bcbb98c905b14fe1f9d69ae18ddf125ee72e102eb
|
data/lib/awful/elb.rb
CHANGED
@@ -77,9 +77,9 @@ module Awful
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
desc 'tags
|
81
|
-
def tags(
|
82
|
-
elb.describe_tags(load_balancer_names:
|
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
|
data/lib/awful/kms.rb
CHANGED
@@ -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
|
data/lib/awful/s3.rb
CHANGED
@@ -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
|
data/lib/awful/version.rb
CHANGED