Package: cloudcast
CloudCast - Easy and powerful stack templates for AWS CloudFormation====================================================================What is it?-----------AWS CloudFormation is pretty powerful, but once your stacks are gettingsophisticated, it can be hard to work with. You may easily getlost in a sea of maps and lists, and it can be hard to keep track ofreferences across your resources.Also, this may be my personal pet peeve, but JSON has no syntax for comments!This makes templates written for CFN hard to document and maintain.With CloudCast you can easily create any template you would write for CFN, butusing plain Python syntax.Resources, Mappings, Parameters and Outputs are defined as Python objects. Itlooks cleaner and you can do smarter stuff with them!For instance:from cloudcast.template import ResourceLoadBalancer = Resource("AWS::ElasticLoadBalancing::LoadBalancer",AvailabilityZones=[ 'us-east-1c', 'us-east-1d' ],HealthCheck={"HealthyThreshold" : "2","Interval" : "30","Target" : "HTTP:80/status","Timeout" : "5","UnhealthyThreshold" : "3"},Listeners=[{"InstancePort" : "80","InstanceProtocol" : 'HTTP',"LoadBalancerPort" : "80","Protocol" : 'HTTP',}]),)If you are familiar with AWS and CFN, this structure shouldn't be strange to you.We have just declared an ELB resource with some properties.Later on, the load balancer may be referenced from a security group, in order tobe allowed to access the service ports in the balanced instances:AppSG = Resource("AWS::EC2::SecurityGroup",GroupDescription = "Allow access app from LB only",SecurityGroupIngress = [ {"IpProtocol" : "tcp","FromPort" : 80,"ToPort" : 80,"SourceSecurityGroupOwnerId" : LoadBalancer['SourceSecurityGroup.OwnerAlias'],"SourceSecurityGroupName": LoadBalancer['SourceSecurityGroup.GroupName'],}])Since you are dealing with Python objects, nothing is stopping you frombundling them in your own libraries and reusing them as necessary. We havean example of that around here (look at the cloudcast.library.stack_user module).In fact, you can create any Python code that may help you making yourtemplates simpler and more expressive!How do you get the JSON templates?----------------------------------Once you've got your template python file (let's call it template.py), you would:from cloudcast import Stackstack = Stack(description = "Sample stack that doesn't do much",env = { ... define environment vars here ... },resources_file = "template.py")print stack.dump_json()The following will happen:1. The Stack class will load, examine your code module and findthe relevant objects to be included in the CloudFormation template (resources,outputs, parameters..). It shouldn't get confused with any other code youmay have there.2. The template will be printed out for you to feed into CloudFormation.Deploying software on the instances-----------------------------------Cloudcast helps you embed your instance software configuration into yourCloudFormation templates. In order to do that, it allows you to leveragesome technologies that are usually applied for this purpose:- [cfn-init](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-init.html)- shell scripts- [ansible](http://www.ansible.com)The support for this is fairly extensible, so it wouldn't be too far fetched to add support for other SCMs like Chef or Puppet.Special thanks--------------[Bright & Shiny](http://brightandshiny.com/) - their support and fineunderstanding of well managed infrastructure, made it possible for me todevote the necessary efforts to evolve this concept.If you are looking for an awesome software agency make sure to check theirwebsite![Lifestreams Technology](http://lifestreams.com/) - developing for theirproducts has proved to be an excellent ground to develop and put intopractice new ideas such as the one that originated this project. Thanksfor the chance to bring CloudCast to the point where it is a key technologyto support mission-critical operations.