@Description 'A coffinized AWS cloudformation template' # params are of the form: # @Param. , [description], [properties] @Param.String 'name', 'This description is optional', AllowedPattern: '[a-zA-Z][-a-zA-Z0-9]*' Default: 'coffinized' @Param.Number 'port' @Param.String 'size', Default: 'micro' # mappings are of the form: # @Mapping , @Mapping 'instanceMap', micro: type: 't1.micro' ami: 'ami-f570b19c' small: type: 'm1.small' ami: 'ami-f170b198' # resources are of the form: # @ , [properties] @AWS.IAM.User 'root', Path: '/' # you're free to use arbitrary coffee-script to simplify things openPort = (port) -> IpProtocol: 'tcp' FromPort: port ToPort: port CidrIp: '0.0.0.0/0' @AWS.EC2.SecurityGroup 'securityGroup', GroupDescription: 'webserver security group' SecurityGroupIngress: [ openPort('22'), #params are referenced like: @Param. openPort(@Params.port) ] @AWS.EC2.Instance 'webserver', #map elements are referenced like: @FindInMap , , ImageId: @FindInMap 'instanceMap', @Params.size, 'ami' InstanceType: @FindInMap 'instanceMap', @Params.size, 'type' #resources are referenced like: @Resources. SecurityGroups: [ @Resources.securityGroup ] #Outputs are of the form: # @Output , [description], @Output 'url', @Join '', 'http://', @GetAtt('webserver', 'PublicDnsName') @Output 'id', 'This description is optional', @Resources.webserver