Skip to Content
Hybrid Cloud for Developers
book

Hybrid Cloud for Developers

by Manoj Hirway
April 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
8h 37m
English
Packt Publishing
Content preview from Hybrid Cloud for Developers

Executing the CloudFormation template

You can execute the CloudFormation template either using the AWS Web Console, the AWS CLI, or the SDK. Since we are focusing on application development, let's write some Python code that executes a template written in the JSON format.

 We will use the same boto3 Python package to create the CloudFormation objects:

import boto3with open('packtpub.json') as template_file:    template = template_file.read()cloud_formation_object = boto3.resource('cloudformation')response = cloud_formation_object.create_stack(StackName = 'test',TemplateBody = template)print(response)print(type(response))

In the preceding program, we create an object of the type cloudformation and then invoke the create_stack() function by passing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hybrid Cloud for Architects

Hybrid Cloud for Architects

Alok Shrivastwa
OpenStack: Building a Cloud Environment

OpenStack: Building a Cloud Environment

Alok Shrivastwa, Sunil Sarat, Kevin Jackson, Cody Bunch, Egle Sigler, Tony Campbell

Publisher Resources

ISBN: 9781788830874Supplemental Content