Add cloudformation tags.

This commit is contained in:
Steve Pulec 2015-08-31 16:48:36 -04:00
commit 1dcfcbca57
3 changed files with 28 additions and 3 deletions

View file

@ -10,7 +10,7 @@ from .exceptions import ValidationError
class FakeStack(object):
def __init__(self, stack_id, name, template, parameters, region_name, notification_arns=None):
def __init__(self, stack_id, name, template, parameters, region_name, notification_arns=None, tags=None):
self.stack_id = stack_id
self.name = name
self.template = template
@ -18,6 +18,7 @@ class FakeStack(object):
self.parameters = parameters
self.region_name = region_name
self.notification_arns = notification_arns if notification_arns else []
self.tags = tags if tags else {}
self.status = 'CREATE_COMPLETE'
self.description = self.template_dict.get('Description')
@ -58,7 +59,7 @@ class CloudFormationBackend(BaseBackend):
self.stacks = {}
self.deleted_stacks = {}
def create_stack(self, name, template, parameters, region_name, notification_arns=None):
def create_stack(self, name, template, parameters, region_name, notification_arns=None, tags=None):
stack_id = generate_stack_id(name)
new_stack = FakeStack(
stack_id=stack_id,
@ -67,6 +68,7 @@ class CloudFormationBackend(BaseBackend):
parameters=parameters,
region_name=region_name,
notification_arns=notification_arns,
tags=tags,
)
self.stacks[stack_id] = new_stack
return new_stack