Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Merge f8f20ea into c2be12a
Browse files Browse the repository at this point in the history
  • Loading branch information
niallcreech committed Jun 23, 2015
2 parents c2be12a + f8f20ea commit 6126492
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
##Unreleased
* Tag stack and created resources created with environment name

## Version 0.5.3 [WIP]
* Improve message content when cfn_create raises an exception and fails.
* Cleanup SSL certificates when cfn_create raises an exception and fails.
Expand Down
5 changes: 3 additions & 2 deletions bootstrap_cfn/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ def __init__(self, aws_profile_name, aws_region_name='eu-west-1'):
self.aws_region_name = aws_region_name
self.conn_cfn = utils.connect_to_aws(boto.cloudformation, self)

def create(self, stack_name, template_body):
def create(self, stack_name, template_body, tags=[]):
stack = self.conn_cfn.create_stack(stack_name=stack_name,
template_body=template_body,
capabilities=['CAPABILITY_IAM'])
capabilities=['CAPABILITY_IAM'],
tags=tags)
return stack

def delete(self, stack_name):
Expand Down
8 changes: 7 additions & 1 deletion bootstrap_cfn/fab_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,13 @@ def cfn_create(test=False):
# print cfn_config.process()
# Inject security groups in stack template and create stacks.
try:
stack = cfn.create(stack_name, cfn_config.process())
# Set a top-level set of tags for the stack, these will propagate
# down so that many of the created resources will be tagged in
# addition. Notable omissions are EC2 volumes and route53 resources
tags = {
"Env": env.environment
}
stack = cfn.create(stack_name, cfn_config.process(), tags=tags)
except:
# cleanup ssl certificates if any
if 'ssl' in cfn_config.data:
Expand Down

0 comments on commit 6126492

Please sign in to comment.