Commit e7e2ea39 by Feanil Patel

Use the bucket name arg.

parent 04e1cc67
...@@ -31,12 +31,12 @@ def upload_file(file_path, bucket_name, key_name): ...@@ -31,12 +31,12 @@ def upload_file(file_path, bucket_name, key_name):
url = 'https://s3.amazonaws.com/{}/{}'.format(bucket_name, key_name) url = 'https://s3.amazonaws.com/{}/{}'.format(bucket_name, key_name)
return url return url
def create_stack(stack_name, template, region='us-east-1', blocking=True): def create_stack(stack_name, template, region='us-east-1', blocking=True, temp_bucket='edx-sandbox-devops'):
cfn = boto.connect_cloudformation() cfn = boto.connect_cloudformation()
# Upload the template to s3 # Upload the template to s3
key_name = 'cloudformation/auto/{}_{}'.format(stack_name, basename(template)) key_name = 'cloudformation/auto/{}_{}'.format(stack_name, basename(template))
template_url = upload_file(template, bucket_name, key_name) template_url = upload_file(template, temp_bucket, key_name)
# Reference the stack. # Reference the stack.
try: try:
...@@ -88,6 +88,7 @@ if __name__ == '__main__': ...@@ -88,6 +88,7 @@ if __name__ == '__main__':
stack_name = args.stackname stack_name = args.stackname
template = args.template template = args.template
region = args.region region = args.region
bucket_name = args.bucketname
create_stack(stack_name, template, region) create_stack(stack_name, template, region, bucket_name)
print('Stack({}) created.'.format(stack_name)) print('Stack({}) created.'.format(stack_name))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment