troposphere documentation

2,472 views
Skip to first unread message

Max Scalf

unread,
Jul 23, 2015, 2:07:54 PM7/23/15
to cloudtools-dev
Hello,

I was wondering if there is any good documents on "troposphere".  I know the below github link has quite a few sample/examples but i wanted to see if there were any docs out there that i can read...


If there are no such docs, how do you guys recommend getting to know more about troposphere? 

Michael Barrett

unread,
Jul 23, 2015, 2:27:59 PM7/23/15
to Max Scalf, cloudtools-dev
Hey Max - the best documentation for troposphere is a mix of the README, and then just going through the Cloudformation documentation.  Troposphere is a (nearly) 1-1 translation of the CloudFormation Template Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html) written in python.

It's mostly for writing those templates.  Why would you do this in troposphere/python rather than Cloudformation/json? A few reasons:
- python is a bit easier to read
- python has comments
- python has loops - which is nice when you want to create 4 of the same resource
- troposphere tries to catch errors up front, without having to push to CloudFormation.  it's not perfect, but it does catch quite a few things.

Troposphere also includes tools like cfn, which allow you to push templates into CloudFormation.

That said, another great way to learn to write troposphere templates is to look at people's existing code for them.  I maintain https://github.com/remind101/stacker, which has some example templates in the blueprints directory for various things.

Your best bet is to get a solid hold on the CloudFormation template reference.  If you want to build an Instance (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) you would use the Instance class in troposphere: https://github.com/cloudtools/troposphere/blob/master/troposphere/ec2.py#L112

As you can see they both have the exact same properties.

One other place to look for examples is the examples directory: https://github.com/cloudtools/troposphere/tree/master/examples - those get translated into Cloudformation templates here: https://github.com/cloudtools/troposphere/tree/master/tests/examples_output

Hope that helps!


--
You received this message because you are subscribed to the Google Groups "cloudtools-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudtools-de...@googlegroups.com.
To post to this group, send email to cloudto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudtools-dev/4d1319ed-7094-4856-b3a7-b3a8d9fb39d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages