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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -7
  3. data/Rakefile +2 -0
  4. data/bin/stack_master +2 -1
  5. data/features/apply.feature +63 -26
  6. data/features/delete.feature +5 -18
  7. data/features/diff.feature +6 -18
  8. data/features/events.feature +1 -5
  9. data/features/outputs.feature +1 -5
  10. data/features/region_aliases.feature +0 -4
  11. data/features/resources.feature +1 -4
  12. data/features/stack_defaults.feature +1 -7
  13. data/features/status.feature +2 -8
  14. data/features/step_definitions/stack_steps.rb +16 -0
  15. data/features/support/env.rb +1 -0
  16. data/features/validate.feature +46 -0
  17. data/lib/stack_master.rb +21 -0
  18. data/lib/stack_master/aws_driver/cloud_formation.rb +20 -1
  19. data/lib/stack_master/cli.rb +54 -27
  20. data/lib/stack_master/command.rb +9 -1
  21. data/lib/stack_master/commands/apply.rb +2 -0
  22. data/lib/stack_master/commands/list_stacks.rb +2 -0
  23. data/lib/stack_master/commands/outputs.rb +2 -1
  24. data/lib/stack_master/commands/status.rb +2 -0
  25. data/lib/stack_master/commands/terminal_helper.rb +15 -0
  26. data/lib/stack_master/commands/validate.rb +1 -1
  27. data/lib/stack_master/config.rb +9 -5
  28. data/lib/stack_master/parameter_resolver.rb +11 -5
  29. data/lib/stack_master/parameter_resolvers/latest_ami_by_tags.rb +3 -1
  30. data/lib/stack_master/parameter_resolvers/secret.rb +3 -1
  31. data/lib/stack_master/parameter_resolvers/security_group.rb +4 -2
  32. data/lib/stack_master/parameter_resolvers/sns_topic_name.rb +3 -1
  33. data/lib/stack_master/parameter_resolvers/stack_output.rb +3 -1
  34. data/lib/stack_master/prompter.rb +10 -3
  35. data/lib/stack_master/resolver_array.rb +35 -0
  36. data/lib/stack_master/testing.rb +1 -0
  37. data/lib/stack_master/validator.rb +8 -4
  38. data/lib/stack_master/version.rb +1 -1
  39. data/spec/fixtures/stack_master.yml +4 -1
  40. data/spec/stack_master/command_spec.rb +28 -0
  41. data/spec/stack_master/commands/apply_spec.rb +12 -2
  42. data/spec/stack_master/commands/status_spec.rb +25 -2
  43. data/spec/stack_master/commands/validate_spec.rb +1 -1
  44. data/spec/stack_master/config_spec.rb +42 -8
  45. data/spec/stack_master/parameter_resolver_spec.rb +6 -2
  46. data/spec/stack_master/parameter_resolvers/security_group_spec.rb +5 -3
  47. data/spec/stack_master/parameter_resolvers/security_groups_spec.rb +32 -0
  48. data/spec/stack_master/prompter_spec.rb +23 -0
  49. data/spec/stack_master/resolver_array_spec.rb +42 -0
  50. data/spec/stack_master/validator_spec.rb +2 -2
  51. metadata +15 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47ceb9c3a194f4352336f7994f8c4034c8d0ff6e
4
- data.tar.gz: a990f7e54348aee9b55378ea9518c1518ae4d4eb
3
+ metadata.gz: 26523ee5aa16ba21756d486d7619b09c2fa2ee77
4
+ data.tar.gz: 56830d0b945a777db396799c98066742d2c1e4bd
5
5
  SHA512:
6
- metadata.gz: 8dafc6386c511101ab2da220d0c632b823fc2add8f6d88430d0cf11f6c94c8256c7b99bc1661f5db3e62051e0383952b3f769baa31dfcae8919305db4390a27e
7
- data.tar.gz: fa452352356d15ba2fc08ab728e6709a72f793250bd325fa990cc8cb9ccfa15a7ec1b75ea5c5af65deedf3b0dd7f952691f0b5797f1d10c042faa83b48121304
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 <region-or-alias> <stack-name> # Create or update a stack
214
- stack_master diff <region-or-alias> <stack-name> # Display a stack tempalte and parameter diff
215
- stack_master delete <region-or-alias> <stack-name> # Delete a stack
216
- stack_master events <region-or-alias> <stack-name> # Display events for a stack
217
- stack_master outputs <region-or-alias> <stack-name> # Display outputs for a stack
218
- stack_master resources <region-or-alias> <stack-name> # Display outputs for a stack
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
@@ -23,3 +23,5 @@ begin
23
23
  end
24
24
  rescue LoadError
25
25
  end
26
+
27
+ task :default => [:features, :spec]
data/bin/stack_master CHANGED
@@ -10,7 +10,8 @@ end
10
10
  trap("SIGINT") { raise StackMaster::CtrlC }
11
11
 
12
12
  begin
13
- StackMaster::CLI.new(ARGV.dup).execute!
13
+ result = StackMaster::CLI.new(ARGV.dup).execute!
14
+ exit !!result
14
15
  rescue StackMaster::CtrlC
15
16
  StackMaster.stdout.puts "Exiting..."
16
17
  end
@@ -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 set the environment variables to:
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` interactively
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 set the environment variables to:
88
- | variable | value |
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 set the environment variables to:
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` interactively
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 I set the environment variables to:
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` interactively
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` interactively
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
  {}
@@ -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 set the environment variables to:
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` interactively
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
- Given I set the environment variables to:
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 set the environment variables to:
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` interactively
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
@@ -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 set the environment variables to:
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` interactively
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 set the environment variables to:
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` interactively
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 set the environment variables to:
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` interactively
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", |
@@ -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
- And I stub the following stack events:
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 |
@@ -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
- And I stub the following stacks:
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`
@@ -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
- And I stub the following stacks:
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` interactively
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: