Add support for SNS notification ARNs in CloudFormation

pull/18777/head
Soenke Ruempler 10 years ago committed by Matt Clay
parent adb53cc3c5
commit b57bcac72f

@ -54,6 +54,12 @@ options:
required: false required: false
default: null default: null
aliases: [] aliases: []
notification_arns:
description:
- The Simple Notification Service (SNS) topic ARNs to publish stack related events.
required: false
default: null
version_added: "2.0"
stack_policy: stack_policy:
description: description:
- the path of the cloudformation stack policy - the path of the cloudformation stack policy
@ -228,6 +234,7 @@ def main():
template_parameters=dict(required=False, type='dict', default={}), template_parameters=dict(required=False, type='dict', default={}),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
template=dict(default=None, required=False), template=dict(default=None, required=False),
notification_arns=dict(default=None, required=False),
stack_policy=dict(default=None, required=False), stack_policy=dict(default=None, required=False),
disable_rollback=dict(default=False, type='bool'), disable_rollback=dict(default=False, type='bool'),
template_url=dict(default=None, required=False), template_url=dict(default=None, required=False),
@ -264,6 +271,8 @@ def main():
else: else:
template_body = json.dumps(yaml.load(template_body), indent=2) template_body = json.dumps(yaml.load(template_body), indent=2)
notification_arns = module.params['notification_arns']
if module.params['stack_policy'] is not None: if module.params['stack_policy'] is not None:
stack_policy_body = open(module.params['stack_policy'], 'r').read() stack_policy_body = open(module.params['stack_policy'], 'r').read()
else: else:
@ -304,6 +313,7 @@ def main():
try: try:
cfn.create_stack(stack_name, parameters=template_parameters_tup, cfn.create_stack(stack_name, parameters=template_parameters_tup,
template_body=template_body, template_body=template_body,
notification_arns=notification_arns,
stack_policy_body=stack_policy_body, stack_policy_body=stack_policy_body,
template_url=template_url, template_url=template_url,
disable_rollback=disable_rollback, disable_rollback=disable_rollback,
@ -326,6 +336,7 @@ def main():
try: try:
cfn.update_stack(stack_name, parameters=template_parameters_tup, cfn.update_stack(stack_name, parameters=template_parameters_tup,
template_body=template_body, template_body=template_body,
notification_arns=notification_arns,
stack_policy_body=stack_policy_body, stack_policy_body=stack_policy_body,
disable_rollback=disable_rollback, disable_rollback=disable_rollback,
template_url=template_url, template_url=template_url,

Loading…
Cancel
Save