minimal_pipeline 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minimal_pipeline/ec2.rb +21 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a176598aea2837b108ae03b7f4cbdeb6b8279635e1741a04cd8a7a24884dc573
|
4
|
+
data.tar.gz: 484ae647f13542f81e8088c34f0abe6408c2eaabbdd60055bd00a1d29eaa34e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b52d92d84ef36ea31f7b1ba9b69c6da3e5f219a6e453cca7920030701d27e6eb84c383b857a34f71882b49924357a978ba671395f10d09c11e8f3bc11e6c1253
|
7
|
+
data.tar.gz: 04c76fe9bccc848e428d5b784b312b650bbec58504e7b8814689797a293c1b27a4dcd1746848b086ac64bf0062e85e3abea283e82d0fe873bfced198b08c8eeb
|
data/lib/minimal_pipeline/ec2.rb
CHANGED
@@ -132,5 +132,26 @@ class MinimalPipeline
|
|
132
132
|
|
133
133
|
new_mappings
|
134
134
|
end
|
135
|
+
|
136
|
+
# Copy an AMI
|
137
|
+
#
|
138
|
+
# The new image will be encrypted. You can optionally copy across regions
|
139
|
+
#
|
140
|
+
# @params image_id [String] The AMI ID to copy
|
141
|
+
# @params kms_key_id [String] Non-default KMS key ID to use for encryption
|
142
|
+
# @params region [String] The destination region for the new image
|
143
|
+
# @return [String] The newly created AMI ID
|
144
|
+
def copy_image(image_id, kms_key_id = nil, region = nil)
|
145
|
+
params = {
|
146
|
+
encrypted: true,
|
147
|
+
source_image_id: image_id,
|
148
|
+
source_region: @region,
|
149
|
+
region: region || @region
|
150
|
+
}
|
151
|
+
params['kms_key_id'] = kms_key_id if kms_key_id
|
152
|
+
|
153
|
+
response = @client.copy_image(params)
|
154
|
+
response.image_id
|
155
|
+
end
|
135
156
|
end
|
136
157
|
end
|