My First troposphere code to create instance (sample)

Below is the troposphere library which is used to convert the python script to json and yaml formats which avoids writing of clouformation 🙂


from troposphere import Ref, Template
import troposphere.ec2 as ec2
t = Template()
instance = ec2.Instance(“myinstance”)
instance.ImageId = “ami-951945d0”
instance.InstanceType = “t1.micro”
with open(‘jaml.yaml’, ‘w’) as f:    // command to create a output file and write to it
with open (‘insta.json’, ‘w’)as f:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s