[cloud] Delete stack using CloudFormation role ARN if available

pull/33725/head
Justin Menga 7 years ago committed by Ryan S. Brown
parent cc802624a6
commit fa313c58c0

@ -651,7 +651,10 @@ def main():
if not stack:
result = {'changed': False, 'output': 'Stack not found.'}
else:
cfn.delete_stack(StackName=stack_params['StackName'])
if stack_params.get('RoleARN') is None:
cfn.delete_stack(StackName=stack_params['StackName'])
else:
cfn.delete_stack(StackName=stack_params['StackName'], RoleARN=stack_params['RoleARN'])
result = stack_operation(cfn, stack_params['StackName'], 'DELETE', stack_params.get('ClientRequestToken', None))
except Exception as err:
module.fail_json(msg=boto_exception(err), exception=traceback.format_exc())

Loading…
Cancel
Save