autostacker24 1.0.19 → 1.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autostacker24/stacker.rb +14 -4
- 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: cac017ad473bb633eb045fd4615a6202684f57cb
|
4
|
+
data.tar.gz: d507d1a19ffd555fe07f6c6ba49c44f2e8647b2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526083a4c67e5b5d5480ca0b94d364ebf507a8d6b07e3155154958eab8b8b1723438ff07bef3e0dc2c4f34e66ae2c4865d504e495b917ee853d51d442737bdd0
|
7
|
+
data.tar.gz: 2bd3cd520c1ca2acc2cdeb244e3ec3c1f6d01f0850109b30769e9e7dd4d489bf7ccac645fa59ca8df80007a49279c5545b3e626536aa734cac05da221d4c0921
|
@@ -3,10 +3,9 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Stacker
|
5
5
|
|
6
|
-
|
7
|
-
@credentials
|
8
|
-
end
|
6
|
+
attr_reader :region, :credentials
|
9
7
|
|
8
|
+
# use ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY'] if you don't want to set credentials by code
|
10
9
|
def credentials=(credentials)
|
11
10
|
unless credentials == @credentials
|
12
11
|
@lazy_cloud_formation = nil
|
@@ -14,6 +13,10 @@ module Stacker
|
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
16
|
+
def region=(region) # use ENV['AWS_REGION'] or ENV['AWS_DEFAULT_REGION']
|
17
|
+
@region = region unless region == @region
|
18
|
+
end
|
19
|
+
|
17
20
|
def create_or_update_stack(stack_name, template, parameters, parent_stack_name = nil)
|
18
21
|
if find_stack(stack_name).nil?
|
19
22
|
create_stack(stack_name, template, parameters, parent_stack_name)
|
@@ -118,7 +121,14 @@ module Stacker
|
|
118
121
|
end
|
119
122
|
|
120
123
|
def cloud_formation # lazy CloudFormation client
|
121
|
-
@lazy_cloud_formation ||= Aws::CloudFormation::Client.new(
|
124
|
+
@lazy_cloud_formation ||= Aws::CloudFormation::Client.new(cloud_formation_parameters)
|
125
|
+
end
|
126
|
+
|
127
|
+
def cloud_formation_parameters
|
128
|
+
params = {}
|
129
|
+
params[:credentials] = @credentials if @credentials
|
130
|
+
params[:region] = @region if @region
|
131
|
+
params
|
122
132
|
end
|
123
133
|
|
124
134
|
def template_body(template)
|