diff --git a/examples/AutoScalingMultiAZWithNotifications.py b/examples/AutoScalingMultiAZWithNotifications.py
new file mode 100755
index 000000000..3d7f6df25
--- /dev/null
+++ b/examples/AutoScalingMultiAZWithNotifications.py
@@ -0,0 +1,658 @@
+#!/usr/bin/env python
+"""
+Converted from AutoScalingMultiAZWithNotifications.template located at:
+http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
+"""
+from __future__ import absolute_import, division, print_function
+
+from troposphere import (
+ autoscaling,
+ Base64,
+ cloudformation,
+ cloudwatch,
+ constants,
+ ec2,
+ FindInMap,
+ GetAtt,
+ GetAZs,
+ Join,
+ Parameter,
+ Output,
+ Ref,
+ sns,
+ Template,
+ )
+import troposphere.elasticloadbalancing as elb
+# from troposphere.autoscaling import (
+# AutoScalingGroup,
+# BlockDeviceMapping,
+# EBSBlockDevice,
+# LaunchConfiguration,
+# Tag,
+# )
+from troposphere.policies import (
+ AutoScalingRollingUpdate,
+ CreationPolicy,
+ ResourceSignal,
+ UpdatePolicy,
+ )
+
+
+def main():
+ """
+ Create a multi-az, load balanced and Auto Scaled sample web site
+ """
+
+ template = Template()
+
+ template.add_version("2010-09-09")
+
+ # Description
+ template.add_description(
+ 'AWS CloudFormation Sample Template '
+ 'AutoScalingMultiAZWithNotifications: Create a multi-az, load '
+ 'balanced and Auto Scaled sample web site running on an Apache '
+ 'Web Serever. The application is configured to '
+ 'span all Availability Zones in the region and is Auto-Scaled '
+ 'based on the CPU utilization of the web servers. Notifications '
+ 'will be sent to the operator email address on scaling events. '
+ 'The instances are load balanced with a simple health check '
+ 'against the default web page. **WARNING** This template creates '
+ 'one or more Amazon EC2 instances and an Elastic Load Balancer. '
+ 'You will be billed for the AWS resources used if you create a '
+ 'stack from this template.'
+ )
+
+ # Mappings
+ template.add_mapping(
+ 'AWSInstanceType2Arch', {
+ "t1.micro": {"Arch": "PV64"},
+ "t2.nano": {"Arch": "HVM64"},
+ "t2.micro": {"Arch": "HVM64"},
+ "t2.small": {"Arch": "HVM64"},
+ "t2.medium": {"Arch": "HVM64"},
+ "t2.large": {"Arch": "HVM64"},
+ "m1.small": {"Arch": "PV64"},
+ "m1.medium": {"Arch": "PV64"},
+ "m1.large": {"Arch": "PV64"},
+ "m1.xlarge": {"Arch": "PV64"},
+ "m2.xlarge": {"Arch": "PV64"},
+ "m2.2xlarge": {"Arch": "PV64"},
+ "m2.4xlarge": {"Arch": "PV64"},
+ "m3.medium": {"Arch": "HVM64"},
+ "m3.large": {"Arch": "HVM64"},
+ "m3.xlarge": {"Arch": "HVM64"},
+ "m3.2xlarge": {"Arch": "HVM64"},
+ "m4.large": {"Arch": "HVM64"},
+ "m4.xlarge": {"Arch": "HVM64"},
+ "m4.2xlarge": {"Arch": "HVM64"},
+ "m4.4xlarge": {"Arch": "HVM64"},
+ "m4.10xlarge": {"Arch": "HVM64"},
+ "c1.medium": {"Arch": "PV64"},
+ "c1.xlarge": {"Arch": "PV64"},
+ "c3.large": {"Arch": "HVM64"},
+ "c3.xlarge": {"Arch": "HVM64"},
+ "c3.2xlarge": {"Arch": "HVM64"},
+ "c3.4xlarge": {"Arch": "HVM64"},
+ "c3.8xlarge": {"Arch": "HVM64"},
+ "c4.large": {"Arch": "HVM64"},
+ "c4.xlarge": {"Arch": "HVM64"},
+ "c4.2xlarge": {"Arch": "HVM64"},
+ "c4.4xlarge": {"Arch": "HVM64"},
+ "c4.8xlarge": {"Arch": "HVM64"},
+ "g2.2xlarge": {"Arch": "HVMG2"},
+ "g2.8xlarge": {"Arch": "HVMG2"},
+ "r3.large": {"Arch": "HVM64"},
+ "r3.xlarge": {"Arch": "HVM64"},
+ "r3.2xlarge": {"Arch": "HVM64"},
+ "r3.4xlarge": {"Arch": "HVM64"},
+ "r3.8xlarge": {"Arch": "HVM64"},
+ "i2.xlarge": {"Arch": "HVM64"},
+ "i2.2xlarge": {"Arch": "HVM64"},
+ "i2.4xlarge": {"Arch": "HVM64"},
+ "i2.8xlarge": {"Arch": "HVM64"},
+ "d2.xlarge": {"Arch": "HVM64"},
+ "d2.2xlarge": {"Arch": "HVM64"},
+ "d2.4xlarge": {"Arch": "HVM64"},
+ "d2.8xlarge": {"Arch": "HVM64"},
+ "hi1.4xlarge": {"Arch": "HVM64"},
+ "hs1.8xlarge": {"Arch": "HVM64"},
+ "cr1.8xlarge": {"Arch": "HVM64"},
+ "cc2.8xlarge": {"Arch": "HVM64"},
+ }
+ )
+
+ template.add_mapping(
+ "AWSInstanceType2NATArch", {
+ "t1.micro": {"Arch": "NATPV64"},
+ "t2.nano": {"Arch": "NATHVM64"},
+ "t2.micro": {"Arch": "NATHVM64"},
+ "t2.small": {"Arch": "NATHVM64"},
+ "t2.medium": {"Arch": "NATHVM64"},
+ "t2.large": {"Arch": "NATHVM64"},
+ "m1.small": {"Arch": "NATPV64"},
+ "m1.medium": {"Arch": "NATPV64"},
+ "m1.large": {"Arch": "NATPV64"},
+ "m1.xlarge": {"Arch": "NATPV64"},
+ "m2.xlarge": {"Arch": "NATPV64"},
+ "m2.2xlarge": {"Arch": "NATPV64"},
+ "m2.4xlarge": {"Arch": "NATPV64"},
+ "m3.medium": {"Arch": "NATHVM64"},
+ "m3.large": {"Arch": "NATHVM64"},
+ "m3.xlarge": {"Arch": "NATHVM64"},
+ "m3.2xlarge": {"Arch": "NATHVM64"},
+ "m4.large": {"Arch": "NATHVM64"},
+ "m4.xlarge": {"Arch": "NATHVM64"},
+ "m4.2xlarge": {"Arch": "NATHVM64"},
+ "m4.4xlarge": {"Arch": "NATHVM64"},
+ "m4.10xlarge": {"Arch": "NATHVM64"},
+ "c1.medium": {"Arch": "NATPV64"},
+ "c1.xlarge": {"Arch": "NATPV64"},
+ "c3.large": {"Arch": "NATHVM64"},
+ "c3.xlarge": {"Arch": "NATHVM64"},
+ "c3.2xlarge": {"Arch": "NATHVM64"},
+ "c3.4xlarge": {"Arch": "NATHVM64"},
+ "c3.8xlarge": {"Arch": "NATHVM64"},
+ "c4.large": {"Arch": "NATHVM64"},
+ "c4.xlarge": {"Arch": "NATHVM64"},
+ "c4.2xlarge": {"Arch": "NATHVM64"},
+ "c4.4xlarge": {"Arch": "NATHVM64"},
+ "c4.8xlarge": {"Arch": "NATHVM64"},
+ "g2.2xlarge": {"Arch": "NATHVMG2"},
+ "g2.8xlarge": {"Arch": "NATHVMG2"},
+ "r3.large": {"Arch": "NATHVM64"},
+ "r3.xlarge": {"Arch": "NATHVM64"},
+ "r3.2xlarge": {"Arch": "NATHVM64"},
+ "r3.4xlarge": {"Arch": "NATHVM64"},
+ "r3.8xlarge": {"Arch": "NATHVM64"},
+ "i2.xlarge": {"Arch": "NATHVM64"},
+ "i2.2xlarge": {"Arch": "NATHVM64"},
+ "i2.4xlarge": {"Arch": "NATHVM64"},
+ "i2.8xlarge": {"Arch": "NATHVM64"},
+ "d2.xlarge": {"Arch": "NATHVM64"},
+ "d2.2xlarge": {"Arch": "NATHVM64"},
+ "d2.4xlarge": {"Arch": "NATHVM64"},
+ "d2.8xlarge": {"Arch": "NATHVM64"},
+ "hi1.4xlarge": {"Arch": "NATHVM64"},
+ "hs1.8xlarge": {"Arch": "NATHVM64"},
+ "cr1.8xlarge": {"Arch": "NATHVM64"},
+ "cc2.8xlarge": {"Arch": "NATHVM64"},
+ }
+ )
+
+ template.add_mapping(
+ "AWSRegionArch2AMI", {
+ "us-east-1": {
+ "PV64": "ami-22111148",
+ "HVM64": "ami-08111162",
+ "HVMG2": "ami-ebcec381",
+ },
+ "us-west-2": {
+ "PV64": "ami-792bc219",
+ "HVM64": "ami-c229c0a2",
+ "HVMG2": "ami-0f28c06f",
+ },
+ "us-west-1": {
+ "PV64": "ami-0e087a6e",
+ "HVM64": "ami-1b0f7d7b",
+ "HVMG2": "ami-ab9defcb"
+ },
+ "eu-west-1": {
+ "PV64": "ami-a5368cd6",
+ "HVM64": "ami-31328842",
+ "HVMG2": "ami-d1d652a2"
+ },
+ "eu-central-1": {
+ "PV64": "ami-2bde3944",
+ "HVM64": "ami-e2df388d",
+ "HVMG2": "ami-5240a73d"
+ },
+ "ap-northeast-1": {
+ "PV64": "ami-37020959",
+ "HVM64": "ami-f80e0596",
+ "HVMG2": "ami-34a9a35a"
+ },
+ "ap-northeast-2": {
+ "PV64": "NOT_SUPPORTED",
+ "HVM64": "ami-6598510b",
+ "HVMG2": "NOT_SUPPORTED"
+ },
+ "ap-southeast-1": {
+ "PV64": "ami-ff0cc79c",
+ "HVM64": "ami-e90dc68a",
+ "HVMG2": "ami-6f6ca70c"
+ },
+ "ap-southeast-2": {
+ "PV64": "ami-f5210196",
+ "HVM64": "ami-f2210191",
+ "HVMG2": "ami-88c1e1eb"
+ },
+ "sa-east-1": {
+ "PV64": "ami-661e930a",
+ "HVM64": "ami-1e159872",
+ "HVMG2": "NOT_SUPPORTED"
+ },
+ "cn-north-1": {
+ "PV64": "ami-08ef2465",
+ "HVM64": "ami-49e22924",
+ "HVMG2": "NOT_SUPPORTED"
+ },
+ }
+ )
+
+ # This craziness is needed to pass pep8 line lengths of <79
+ regions = [
+ 'us-east-1',
+ 'us-west-2',
+ 'us-west-1',
+ 'eu-west-1',
+ 'sa-east-1',
+ 'eu-central-1',
+ 'ap-southeast-1',
+ 'ap-northeast-1',
+ 'ap-northeast-2',
+ 'ap-southeast-2',
+ 'cn-north-1',
+ ]
+ example_map = {}
+ for a_region in regions:
+ if a_region == 'us-east-1':
+ example_prefix = ('https://s3.amazonaws.com/cloudformat'
+ 'ion-examples-')
+ elif a_region == 'cn-north-1':
+ example_prefix = ('https://s3.cn-north-1.amazonaws.com.cn/cloudfo'
+ 'rmation-examples-')
+ else:
+ example_prefix = 'https://s3-' + \
+ a_region + \
+ '.amazonaws.com/cloudformation-examples-'
+ example_map[a_region] = {
+ "Examples": example_prefix + a_region
+ }
+ template.add_mapping(
+ "Region2Examples", example_map
+ )
+
+ # Parameters
+
+ allowedinstancetype = [
+ "t1.micro",
+ "t2.nano",
+ "t2.micro",
+ "t2.small",
+ "t2.medium",
+ "t2.large",
+ "m1.small",
+ "m1.medium",
+ "m1.large",
+ "m1.xlarge",
+ "m2.xlarge",
+ "m2.2xlarge",
+ "m2.4xlarge",
+ "m3.medium",
+ "m3.large",
+ "m3.xlarge",
+ "m3.2xlarge",
+ "m4.large",
+ "m4.xlarge",
+ "m4.2xlarge",
+ "m4.4xlarge",
+ "m4.10xlarge",
+ "c1.medium",
+ "c1.xlarge",
+ "c3.large",
+ "c3.xlarge",
+ "c3.2xlarge",
+ "c3.4xlarge",
+ "c3.8xlarge",
+ "c4.large",
+ "c4.xlarge",
+ "c4.2xlarge",
+ "c4.4xlarge",
+ "c4.8xlarge",
+ "g2.2xlarge",
+ "g2.8xlarge",
+ "r3.large",
+ "r3.xlarge",
+ "r3.2xlarge",
+ "r3.4xlarge",
+ "r3.8xlarge",
+ "i2.xlarge",
+ "i2.2xlarge",
+ "i2.4xlarge",
+ "i2.8xlarge",
+ "d2.xlarge",
+ "d2.2xlarge",
+ "d2.4xlarge",
+ "d2.8xlarge",
+ "hi1.4xlarge",
+ "hs1.8xlarge",
+ "cr1.8xlarge",
+ "cc2.8xlarge",
+ "cg1.4xlarge",
+ ]
+
+ instancetype = template.add_parameter(Parameter(
+ 'InstanceType',
+ Description='WebServer EC2 instance type',
+ Type='String',
+ Default='t2.small',
+ AllowedValues=allowedinstancetype,
+ ConstraintDescription='must be a valid EC2 instance type.',
+ ))
+
+ keyname = template.add_parameter(Parameter(
+ 'KeyName',
+ Description='The EC2 Key Pair to allow SSH access to the instances',
+ Type='AWS::EC2::KeyPair::KeyName',
+ ConstraintDescription='must be the name of an existing EC2 KeyPair.',
+ ))
+
+ operatoremail = template.add_parameter(Parameter(
+ 'OperatorEMail',
+ AllowedPattern=(
+ '([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.'
+ '[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9'
+ '\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)'
+ ),
+ ConstraintDescription="must be a valid email address.",
+ Description=("EMail address to notify if there are any scaling "
+ "operations"),
+ Type=constants.STRING,
+ ))
+
+ sshlocation = template.add_parameter(Parameter(
+ 'SSHLocation',
+ Description='The IP address range that can be used to SSH to'
+ ' the EC2 instances',
+ Type='String',
+ MinLength='9',
+ MaxLength='18',
+ Default='0.0.0.0/0',
+ AllowedPattern=(
+ '(\\d{1,3})\\.(\\d{1,3})\\.'
+ '(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})'
+ ),
+ ConstraintDescription='must be a valid IP CIDR range of the'
+ ' form x.x.x.x/x.'
+ ))
+
+ # Resources
+
+ r_elb = template.add_resource(
+ elb.LoadBalancer(
+ 'ElasticLoadBalancer',
+ AvailabilityZones=GetAZs(''),
+ CrossZone=True,
+ HealthCheck=elb.HealthCheck(
+ HealthyThreshold='3',
+ Interval='30',
+ Target='HTTP:80/',
+ Timeout='5',
+ UnhealthyThreshold='5',
+ ),
+ Listeners=[
+ elb.Listener(
+ InstancePort='80',
+ LoadBalancerPort='80',
+ Protocol='HTTP',
+ )
+ ],
+ )
+ )
+
+ r_snstopic = template.add_resource(
+ sns.Topic(
+ 'NotificationTopic',
+ Subscription=[
+ sns.Subscription(
+ 'NotificationSubscription',
+ Endpoint=Ref(operatoremail),
+ Protocol='email',
+ )
+ ]
+ )
+ )
+
+ webserversg = template.add_resource(ec2.SecurityGroup(
+ 'InstanceSecurityGroup',
+ GroupDescription=('Enable SSH access and HTTP from '
+ 'the load balancer only'),
+ SecurityGroupIngress=[
+ ec2.SecurityGroupRule(
+ IpProtocol='tcp',
+ FromPort='22',
+ ToPort='22',
+ CidrIp=Ref(sshlocation),
+ ),
+ ec2.SecurityGroupRule(
+ IpProtocol='tcp',
+ FromPort='80',
+ ToPort='80',
+ SourceSecurityGroupName=GetAtt(
+ r_elb,
+ 'SourceSecurityGroup.GroupName',
+ ),
+ SourceSecurityGroupOwnerId=GetAtt(
+ r_elb,
+ 'SourceSecurityGroup.OwnerAlias',
+ ),
+ )
+ ]
+ ))
+
+ cfn_init = [
+ '[cfn-auto-reloader-hook]\n',
+ 'triggers=post.update\n',
+ 'path=Resources.LaunchConfig.Metadata'
+ '.AWS::CloudFormation::Init\n',
+ 'action=/opt/aws/bin/cfn-init -v ',
+ ' --stack ', Ref('AWS::StackName'),
+ ' --resource LaunchConfig ',
+ ' --region ', Ref('AWS::Region'),
+ '\n',
+ 'runas=root\n'
+ ]
+
+ r_launchconfig = template.add_resource(
+ autoscaling.LaunchConfiguration(
+ 'LaunchConfig',
+ Metadata=cloudformation.Metadata(
+ cloudformation.Init({
+ 'config': cloudformation.InitConfig(
+ packages={
+ 'yum': {
+ 'httpd': [],
+ }
+ },
+
+ files=cloudformation.InitFiles({
+ ('/var/www/html'
+ '/index.html'): cloudformation.InitFile(
+ content=Join('\n', [
+ "'),
+ ('