Conversation
| CfnManage::CloudFormation::EnvironmentRunStop.new().stop_environment($options['STACK_NAME'], 'stack') | ||
| elsif $options['STACK_TAG'] | ||
| CfnManage::CloudFormation::EnvironmentRunStop.new().stop_environment($options['STACK_TAG'], 'tag') | ||
| end |
There was a problem hiding this comment.
show the user an error if either STACK_NAME or STACK_TAG isn't supplied
| CfnManage::CloudFormation::EnvironmentRunStop.new().start_environment($options['STACK_NAME'], 'stack') | ||
| elsif $options['STACK_TAG'] | ||
| CfnManage::CloudFormation::EnvironmentRunStop.new().start_environment($options['STACK_TAG'], 'tag') | ||
| end |
There was a problem hiding this comment.
show the user an error if either STACK_NAME or STACK_TAG isn't supplied
| elsif arg_type == 'stack' | ||
| stacks.push(arg) | ||
| end | ||
|
|
There was a problem hiding this comment.
throw an error if no stacks are found
|
|
||
| tag_key = tag.split('=')[0] | ||
| tag_value = tag.split('=')[1] | ||
|
|
There was a problem hiding this comment.
handle --stack-tag input if format is not equal to key=value and return error to user
Samseppiol
left a comment
There was a problem hiding this comment.
few comments/suggestions. Likely being a little fussy
|
|
||
| lookup_results = [] | ||
|
|
||
| tag_key = tag.split('=')[0] |
There was a problem hiding this comment.
possibly being pedantic but could you simplify to
tag_key, tag_value = tag.split('=')
Unless you're expecting more than two elements?
| tag_value = tag.split('=')[1] | ||
|
|
||
| cf_resource = Aws::CloudFormation::Resource.new() | ||
| stack_collection = cf_resource.stacks.each { |stack| |
There was a problem hiding this comment.
why assign the loop to a variable?
| cf_resource = Aws::CloudFormation::Resource.new() | ||
| stack_collection = cf_resource.stacks.each { |stack| | ||
| next if !stack.root_id.nil? | ||
| stack.tags.each { |tag| |
There was a problem hiding this comment.
could you use .select here instead of .each
No description provided.