stack_master 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +52 -7
- data/Rakefile +2 -0
- data/bin/stack_master +2 -1
- data/features/apply.feature +63 -26
- data/features/delete.feature +5 -18
- data/features/diff.feature +6 -18
- data/features/events.feature +1 -5
- data/features/outputs.feature +1 -5
- data/features/region_aliases.feature +0 -4
- data/features/resources.feature +1 -4
- data/features/stack_defaults.feature +1 -7
- data/features/status.feature +2 -8
- data/features/step_definitions/stack_steps.rb +16 -0
- data/features/support/env.rb +1 -0
- data/features/validate.feature +46 -0
- data/lib/stack_master.rb +21 -0
- data/lib/stack_master/aws_driver/cloud_formation.rb +20 -1
- data/lib/stack_master/cli.rb +54 -27
- data/lib/stack_master/command.rb +9 -1
- data/lib/stack_master/commands/apply.rb +2 -0
- data/lib/stack_master/commands/list_stacks.rb +2 -0
- data/lib/stack_master/commands/outputs.rb +2 -1
- data/lib/stack_master/commands/status.rb +2 -0
- data/lib/stack_master/commands/terminal_helper.rb +15 -0
- data/lib/stack_master/commands/validate.rb +1 -1
- data/lib/stack_master/config.rb +9 -5
- data/lib/stack_master/parameter_resolver.rb +11 -5
- data/lib/stack_master/parameter_resolvers/latest_ami_by_tags.rb +3 -1
- data/lib/stack_master/parameter_resolvers/secret.rb +3 -1
- data/lib/stack_master/parameter_resolvers/security_group.rb +4 -2
- data/lib/stack_master/parameter_resolvers/sns_topic_name.rb +3 -1
- data/lib/stack_master/parameter_resolvers/stack_output.rb +3 -1
- data/lib/stack_master/prompter.rb +10 -3
- data/lib/stack_master/resolver_array.rb +35 -0
- data/lib/stack_master/testing.rb +1 -0
- data/lib/stack_master/validator.rb +8 -4
- data/lib/stack_master/version.rb +1 -1
- data/spec/fixtures/stack_master.yml +4 -1
- data/spec/stack_master/command_spec.rb +28 -0
- data/spec/stack_master/commands/apply_spec.rb +12 -2
- data/spec/stack_master/commands/status_spec.rb +25 -2
- data/spec/stack_master/commands/validate_spec.rb +1 -1
- data/spec/stack_master/config_spec.rb +42 -8
- data/spec/stack_master/parameter_resolver_spec.rb +6 -2
- data/spec/stack_master/parameter_resolvers/security_group_spec.rb +5 -3
- data/spec/stack_master/parameter_resolvers/security_groups_spec.rb +32 -0
- data/spec/stack_master/prompter_spec.rb +23 -0
- data/spec/stack_master/resolver_array_spec.rb +42 -0
- data/spec/stack_master/validator_spec.rb +2 -2
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26523ee5aa16ba21756d486d7619b09c2fa2ee77
|
4
|
+
data.tar.gz: 56830d0b945a777db396799c98066742d2c1e4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eff6fcc6ca243f1149db52968c0effc3e963cb161ed4a88863fc420932bd3c3297c895d964fe3acd1a0d0c036ba64ece99f2c8d6093e4d9dc24f951276d9d427
|
7
|
+
data.tar.gz: 9623fa5996449668f58d9c1f34b3774b5469d6332ba56c011773264654b0e8e91e50a9590ef02c0a1030f90b8b29db025096fa515dd358f33a95d4e445415289
|
data/README.md
CHANGED
@@ -151,6 +151,16 @@ ssh_sg:
|
|
151
151
|
security_group: SSHSecurityGroup
|
152
152
|
```
|
153
153
|
|
154
|
+
### Security Groups
|
155
|
+
|
156
|
+
An array of security group names can also be provided.
|
157
|
+
```yaml
|
158
|
+
ssh_sg:
|
159
|
+
security_groups:
|
160
|
+
- SSHSecurityGroup
|
161
|
+
- WebAccessSecurityGroup
|
162
|
+
```
|
163
|
+
|
154
164
|
### SNS Topic
|
155
165
|
|
156
166
|
Looks up an SNS topic by name and returns the ARN.
|
@@ -169,6 +179,8 @@ web_ami:
|
|
169
179
|
latest_ami_by_tags: role=web,application=myapp
|
170
180
|
```
|
171
181
|
|
182
|
+
Note that the corresponding array resolver is named `latest_amis_by_tags`
|
183
|
+
|
172
184
|
### Custom parameter resolvers
|
173
185
|
|
174
186
|
New parameter resolvers can be created in a separate gem.
|
@@ -184,7 +196,9 @@ lib/stack_master/parameter_resolvers/my_resolver.rb
|
|
184
196
|
```ruby
|
185
197
|
module StackMaster
|
186
198
|
module ParameterResolvers
|
187
|
-
class MyResolver
|
199
|
+
class MyResolver < Resolver
|
200
|
+
array_resolver # Also create a MyResolvers resolver to handle arrays
|
201
|
+
|
188
202
|
def initialize(config, stack_definition)
|
189
203
|
@config = config
|
190
204
|
@stack_definition = stack_definition
|
@@ -204,18 +218,49 @@ vpc_id:
|
|
204
218
|
my_resolver: dummy_value
|
205
219
|
```
|
206
220
|
|
221
|
+
## Resolver Arrays
|
222
|
+
|
223
|
+
Most resolvers support taking an array of values that will each be resolved.
|
224
|
+
Unless stated otherwise in the documentation, the array version of the
|
225
|
+
resolver will be named with the [pluralized](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-pluralize)
|
226
|
+
name of the original resolver.
|
227
|
+
|
228
|
+
When creating a new resolver, one can automatically create the array resolver by adding a `array_resolver` statement
|
229
|
+
in the class definition, with an optional class name if different from the default one.
|
230
|
+
```
|
231
|
+
module StackMaster
|
232
|
+
module ParameterResolvers
|
233
|
+
class MyResolver < Resolver
|
234
|
+
array_resolver class_name: 'MyCustomArrayResolver'
|
235
|
+
...
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
```
|
240
|
+
In that example, using the array resolver would look like:
|
241
|
+
```
|
242
|
+
my_parameter:
|
243
|
+
my_custom_array_resolver:
|
244
|
+
- value1
|
245
|
+
- value2
|
246
|
+
```
|
247
|
+
|
207
248
|
## Commands
|
208
249
|
|
209
250
|
```bash
|
210
251
|
stack_master help # Display up to date docs on the commands available
|
211
252
|
stack_master init # Initialises a directory structure and stack_master.yml file
|
212
253
|
stack_master list # Lists stack definitions
|
213
|
-
stack_master apply
|
214
|
-
stack_master
|
215
|
-
stack_master
|
216
|
-
stack_master
|
217
|
-
stack_master
|
218
|
-
stack_master
|
254
|
+
stack_master apply [region-or-alias] [stack-name] # Create or update a stack
|
255
|
+
stack_master apply [region-or-alias] [stack-name] [region-or-alias] [stack-name] # Create or update multiple stacks
|
256
|
+
stack_master apply [region-or-alias] # Create or update stacks in the given region
|
257
|
+
stack_master apply # Create or update all stacks
|
258
|
+
stack_master --yes apply [region-or-alias] [stack-name] # Create or update a stack non-interactively (forcing yes)
|
259
|
+
stack_master diff [region-or-alias] [stack-name] # Display a stack tempalte and parameter diff
|
260
|
+
stack_master delete [region-or-alias] [stack-name] # Delete a stack
|
261
|
+
stack_master events [region-or-alias] [stack-name] # Display events for a stack
|
262
|
+
stack_master outputs [region-or-alias] [stack-name] # Display outputs for a stack
|
263
|
+
stack_master resources [region-or-alias] [stack-name] # Display outputs for a stack
|
219
264
|
stack_master status # Displays the status of each stack
|
220
265
|
```
|
221
266
|
|
data/Rakefile
CHANGED
data/bin/stack_master
CHANGED
data/features/apply.feature
CHANGED
@@ -62,19 +62,13 @@ Feature: Apply command
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
"""
|
65
|
-
And I set the environment variables to:
|
66
|
-
| variable | value |
|
67
|
-
| STUB_AWS | true |
|
68
65
|
|
69
66
|
Scenario: Run apply and create a new stack
|
70
|
-
Given I
|
71
|
-
| variable | value |
|
72
|
-
| ANSWER | y |
|
73
|
-
And I stub the following stack events:
|
67
|
+
Given I stub the following stack events:
|
74
68
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
75
69
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
76
70
|
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
77
|
-
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
71
|
+
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
78
72
|
And the output should contain all of these lines:
|
79
73
|
| Stack diff: |
|
80
74
|
| + "Vpc": { |
|
@@ -84,10 +78,8 @@ Feature: Apply command
|
|
84
78
|
Then the exit status should be 0
|
85
79
|
|
86
80
|
Scenario: Run apply and don't create the stack
|
87
|
-
Given I
|
88
|
-
|
89
|
-
| ANSWER | n |
|
90
|
-
When I run `stack_master apply us-east-1 myapp-vpc --trace` interactively
|
81
|
+
Given I will answer prompts with "n"
|
82
|
+
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
91
83
|
And the output should contain all of these lines:
|
92
84
|
| Stack diff: |
|
93
85
|
| + "Vpc": { |
|
@@ -97,11 +89,62 @@ Feature: Apply command
|
|
97
89
|
And the output should not match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack CREATE_COMPLETE/
|
98
90
|
Then the exit status should be 0
|
99
91
|
|
92
|
+
Scenario: Run apply with region only and create 2 stacks
|
93
|
+
Given I stub the following stack events:
|
94
|
+
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
95
|
+
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
96
|
+
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
97
|
+
| 1 | 1 | myapp-web | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
98
|
+
| 1 | 1 | myapp-web | myapp-web | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
99
|
+
When I run `stack_master apply us-east-1 --trace`
|
100
|
+
And the output should contain all of these lines:
|
101
|
+
| Stack diff: |
|
102
|
+
| + "Vpc": { |
|
103
|
+
| Parameters diff: |
|
104
|
+
| KeyName: my-key |
|
105
|
+
|
106
|
+
Scenario: Run apply nothing and create 2 stacks
|
107
|
+
Given I stub the following stack events:
|
108
|
+
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
109
|
+
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
110
|
+
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
111
|
+
| 1 | 1 | myapp-web | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
112
|
+
| 1 | 1 | myapp-web | myapp-web | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
113
|
+
When I run `stack_master apply --trace`
|
114
|
+
And the output should contain all of these lines:
|
115
|
+
| Stack diff: |
|
116
|
+
| + "Vpc": { |
|
117
|
+
| Parameters diff: |
|
118
|
+
| KeyName: my-key |
|
119
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack CREATE_COMPLETE/
|
120
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-web AWS::CloudFormation::Stack CREATE_COMPLETE/
|
121
|
+
Then the exit status should be 0
|
122
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack CREATE_COMPLETE/
|
123
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-web AWS::CloudFormation::Stack CREATE_COMPLETE/
|
124
|
+
Then the exit status should be 0
|
125
|
+
|
126
|
+
Scenario: Run apply with 2 specific stacks and create 2 stacks
|
127
|
+
Given I stub the following stack events:
|
128
|
+
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
129
|
+
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
130
|
+
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
131
|
+
| 1 | 1 | myapp-web | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
132
|
+
| 1 | 1 | myapp-web | myapp-web | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
133
|
+
When I run `stack_master apply us-east-1 myapp-vpc us-east-1 myapp-web --trace`
|
134
|
+
And the output should contain all of these lines:
|
135
|
+
| Stack diff: |
|
136
|
+
| + "Vpc": { |
|
137
|
+
| Parameters diff: |
|
138
|
+
| KeyName: my-key |
|
139
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack CREATE_COMPLETE/
|
140
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-web AWS::CloudFormation::Stack CREATE_COMPLETE/
|
141
|
+
Then the exit status should be 0
|
142
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack CREATE_COMPLETE/
|
143
|
+
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-web AWS::CloudFormation::Stack CREATE_COMPLETE/
|
144
|
+
Then the exit status should be 0
|
145
|
+
|
100
146
|
Scenario: Run apply on an existing stack
|
101
|
-
Given I
|
102
|
-
| variable | value |
|
103
|
-
| ANSWER | y |
|
104
|
-
And I stub the following stack events:
|
147
|
+
Given I stub the following stack events:
|
105
148
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
106
149
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
107
150
|
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
@@ -141,7 +184,7 @@ Feature: Apply command
|
|
141
184
|
}
|
142
185
|
}
|
143
186
|
"""
|
144
|
-
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
187
|
+
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
145
188
|
And the output should contain all of these lines:
|
146
189
|
| Stack diff: |
|
147
190
|
| - "TestSg2": { |
|
@@ -149,10 +192,7 @@ Feature: Apply command
|
|
149
192
|
Then the exit status should be 0
|
150
193
|
|
151
194
|
Scenario: Create a stack using a stack output resolver
|
152
|
-
Given
|
153
|
-
| variable | value |
|
154
|
-
| ANSWER | y |
|
155
|
-
And a file named "parameters/myapp_web.yml" with:
|
195
|
+
Given a file named "parameters/myapp_web.yml" with:
|
156
196
|
"""
|
157
197
|
VpcId:
|
158
198
|
stack_output: myapp-vpc/VpcId
|
@@ -164,7 +204,7 @@ Feature: Apply command
|
|
164
204
|
And I stub the following stacks:
|
165
205
|
| stack_id | stack_name | region | outputs |
|
166
206
|
| 1 | myapp-vpc | us-east-1 | VpcId=vpc-xxxxxx |
|
167
|
-
When I run `stack_master apply us-east-1 myapp-web --trace`
|
207
|
+
When I run `stack_master apply us-east-1 myapp-web --trace`
|
168
208
|
And the output should contain all of these lines:
|
169
209
|
| Stack diff: |
|
170
210
|
| + "TestSg": { |
|
@@ -188,9 +228,6 @@ Feature: Apply command
|
|
188
228
|
"""
|
189
229
|
{}
|
190
230
|
"""
|
191
|
-
And I set the environment variables to:
|
192
|
-
| variable | value |
|
193
|
-
| ANSWER | y |
|
194
231
|
And I stub the following stack events:
|
195
232
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
196
233
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
@@ -231,7 +268,7 @@ Feature: Apply command
|
|
231
268
|
}
|
232
269
|
}
|
233
270
|
"""
|
234
|
-
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
271
|
+
When I run `stack_master apply us-east-1 myapp-vpc --trace`
|
235
272
|
Then the stack "myapp-vpc" should have a policy with the following:
|
236
273
|
"""
|
237
274
|
{}
|
data/features/delete.feature
CHANGED
@@ -1,41 +1,28 @@
|
|
1
1
|
Feature: Delete command
|
2
2
|
|
3
|
-
Background:
|
4
|
-
Given I set the environment variables to:
|
5
|
-
| variable | value |
|
6
|
-
| STUB_AWS | true |
|
7
|
-
|
8
3
|
Scenario: Run a delete command on a stack that exists
|
9
|
-
Given I
|
10
|
-
| variable | value |
|
11
|
-
| ANSWER | y |
|
12
|
-
And I stub the following stacks:
|
4
|
+
Given I stub the following stacks:
|
13
5
|
| stack_id | stack_name | parameters | region |
|
14
6
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 |
|
15
7
|
And I stub the following stack events:
|
16
8
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
17
9
|
| 1 | 1 | myapp-vpc | myapp-vpc | DELETE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
18
|
-
When I run `stack_master delete us-east-1 myapp-vpc --trace`
|
10
|
+
When I run `stack_master delete us-east-1 myapp-vpc --trace`
|
19
11
|
And the output should match /2020-10-29 00:00:00 \+[0-9]{4} myapp-vpc AWS::CloudFormation::Stack DELETE_COMPLETE/
|
20
12
|
Then the exit status should be 0
|
21
13
|
|
22
14
|
Scenario: Run a delete command on a stack that does not exists
|
23
|
-
|
24
|
-
| variable | value |
|
25
|
-
| ANSWER | y |
|
26
|
-
When I run `stack_master delete us-east-1 myapp-vpc --trace` interactively
|
15
|
+
When I run `stack_master delete us-east-1 myapp-vpc --trace`
|
27
16
|
And the output should contain all of these lines:
|
28
17
|
| Stack does not exist |
|
29
18
|
Then the exit status should be 0
|
30
19
|
|
31
20
|
Scenario: Answer no when asked to delete stack
|
32
|
-
Given I
|
33
|
-
| variable | value |
|
34
|
-
| ANSWER | n |
|
21
|
+
Given I will answer prompts with "n"
|
35
22
|
And I stub the following stacks:
|
36
23
|
| stack_id | stack_name | parameters | region |
|
37
24
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 |
|
38
|
-
When I run `stack_master delete us-east-1 myapp-vpc --trace`
|
25
|
+
When I run `stack_master delete us-east-1 myapp-vpc --trace`
|
39
26
|
And the output should contain all of these lines:
|
40
27
|
| Stack update aborted |
|
41
28
|
Then the exit status should be 0
|
data/features/diff.feature
CHANGED
@@ -47,15 +47,9 @@ Feature: Diff command
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
"""
|
50
|
-
And I set the environment variables to:
|
51
|
-
| variable | value |
|
52
|
-
| STUB_AWS | true |
|
53
50
|
|
54
51
|
Scenario: Run diff on a stack with no changes
|
55
|
-
Given I
|
56
|
-
| variable | value |
|
57
|
-
| ANSWER | y |
|
58
|
-
And I stub the following stacks:
|
52
|
+
Given I stub the following stacks:
|
59
53
|
| stack_id | stack_name | parameters | region |
|
60
54
|
| 1 | myapp-vpc | KeyName=changed-key | us-east-1 |
|
61
55
|
And I stub a template for the stack "myapp-vpc":
|
@@ -91,17 +85,14 @@ Feature: Diff command
|
|
91
85
|
}
|
92
86
|
}
|
93
87
|
"""
|
94
|
-
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
88
|
+
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
95
89
|
And the output should contain all of these lines:
|
96
90
|
| -KeyName: changed |
|
97
91
|
| +KeyName: my-key |
|
98
92
|
Then the exit status should be 0
|
99
93
|
|
100
94
|
Scenario: Run diff on a stack with parameter changes
|
101
|
-
Given I
|
102
|
-
| variable | value |
|
103
|
-
| ANSWER | y |
|
104
|
-
And I stub the following stacks:
|
95
|
+
Given I stub the following stacks:
|
105
96
|
| stack_id | stack_name | parameters | region |
|
106
97
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 |
|
107
98
|
And I stub a template for the stack "myapp-vpc":
|
@@ -137,17 +128,14 @@ Feature: Diff command
|
|
137
128
|
}
|
138
129
|
}
|
139
130
|
"""
|
140
|
-
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
131
|
+
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
141
132
|
And the output should contain all of these lines:
|
142
133
|
| Stack diff: No changes |
|
143
134
|
| Parameters diff: No changes |
|
144
135
|
Then the exit status should be 0
|
145
136
|
|
146
137
|
Scenario: Run diff on a stack with template changes
|
147
|
-
Given I
|
148
|
-
| variable | value |
|
149
|
-
| ANSWER | y |
|
150
|
-
And I stub the following stacks:
|
138
|
+
Given I stub the following stacks:
|
151
139
|
| stack_id | stack_name | parameters | region |
|
152
140
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 |
|
153
141
|
And I stub a template for the stack "myapp-vpc":
|
@@ -183,7 +171,7 @@ Feature: Diff command
|
|
183
171
|
}
|
184
172
|
}
|
185
173
|
"""
|
186
|
-
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
174
|
+
When I run `stack_master diff us-east-1 myapp-vpc --trace`
|
187
175
|
And the output should contain all of these lines:
|
188
176
|
| - "GroupDescription": "Changed description" |
|
189
177
|
| + "GroupDescription": "Test SG 2", |
|
data/features/events.feature
CHANGED
@@ -23,13 +23,9 @@ Feature: Events command
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
"""
|
26
|
-
And I set the environment variables to:
|
27
|
-
| variable | value |
|
28
|
-
| STUB_AWS | true |
|
29
|
-
| ANSWER | y |
|
30
26
|
|
31
27
|
Scenario: View events
|
32
|
-
|
28
|
+
Given I stub the following stack events:
|
33
29
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
34
30
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
35
31
|
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
data/features/outputs.feature
CHANGED
@@ -22,13 +22,9 @@ Feature: Outputs command
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
"""
|
25
|
-
And I set the environment variables to:
|
26
|
-
| variable | value |
|
27
|
-
| STUB_AWS | true |
|
28
|
-
| ANSWER | y |
|
29
25
|
|
30
26
|
Scenario: Output stack resources
|
31
|
-
|
27
|
+
Given I stub the following stacks:
|
32
28
|
| stack_id | stack_name | parameters | region | outputs |
|
33
29
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 | VpcId=vpc-123456 |
|
34
30
|
And I stub a template for the stack "myapp-vpc":
|
@@ -50,10 +50,6 @@ Feature: Region aliases
|
|
50
50
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
51
51
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
52
52
|
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
53
|
-
And I set the environment variables to:
|
54
|
-
| variable | value |
|
55
|
-
| STUB_AWS | true |
|
56
|
-
| ANSWER | y |
|
57
53
|
|
58
54
|
Scenario: Create a stack using region aliases
|
59
55
|
When I run `stack_master apply staging myapp-vpc --trace`
|
data/features/resources.feature
CHANGED
@@ -22,12 +22,9 @@ Feature: Resources command
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
"""
|
25
|
-
And I set the environment variables to:
|
26
|
-
| variable | value |
|
27
|
-
| STUB_AWS | true |
|
28
25
|
|
29
26
|
Scenario: Show resources
|
30
|
-
|
27
|
+
Given I stub the following stacks:
|
31
28
|
| stack_id | stack_name | parameters | region |
|
32
29
|
| 1 | myapp-vpc | KeyName=my-key | us-east-1 |
|
33
30
|
And I stub the following stack resources:
|
@@ -71,15 +71,9 @@ Feature: Stack defaults
|
|
71
71
|
| stack_id | event_id | stack_name | logical_resource_id | resource_status | resource_type | timestamp |
|
72
72
|
| 1 | 1 | myapp-vpc | TestSg | CREATE_COMPLETE | AWS::EC2::SecurityGroup | 2020-10-29 00:00:00 |
|
73
73
|
| 1 | 1 | myapp-vpc | myapp-vpc | CREATE_COMPLETE | AWS::CloudFormation::Stack | 2020-10-29 00:00:00 |
|
74
|
-
And I set the environment variables to:
|
75
|
-
| variable | value |
|
76
|
-
| STUB_AWS | true |
|
77
|
-
Given I set the environment variables to:
|
78
|
-
| variable | value |
|
79
|
-
| ANSWER | y |
|
80
74
|
|
81
75
|
Scenario: Create a stack with inherited attributes
|
82
|
-
When I run `stack_master apply ap-southeast-2 myapp-vpc --trace`
|
76
|
+
When I run `stack_master apply ap-southeast-2 myapp-vpc --trace`
|
83
77
|
Then the stack "myapp-vpc" should contain this notification ARN "test_arn_1"
|
84
78
|
Then the stack "myapp-vpc" should contain this notification ARN "test_arn_3"
|
85
79
|
And the stack "myapp-vpc" should have a policy with the following:
|