title: Create AWS SNS topic and reference it in an ASG using troposhere
body: <p>I am trying to create a SNS topic and reference that topic in an ASG to get notifications when instances launches or terminates. Here is a section of troposphere code I am using:</p>
  
  <pre><code>    email_topic = self.template.add_resource(Topic(
          'ec2_lauch_termination',
          Subscription=[
              Subscription(
                  Endpoint=Ref(alarm_email),
                  Protocol="email"
              ),
          ],
      ))
  
      self.template.add_output(Output(
              "TopicArn",
              Value=GetAtt(email_topic, "Arn"),
              Description="ARN of email topic",
      ))
  
      for i in range(0, self.subnet_count):
              asg_name = "autoScalingGroup" + str(i)
              asg = self.template.add_resource(AutoScalingGroup(
                  asg_name,
                  DesiredCapacity=Ref(self.desired_capacity),
                  HealthCheckType="EC2",
                  LaunchConfigurationName=Ref(launch_config),
                  MinSize=Ref(self.min_size),
                  MaxSize=Ref(self.max_size),
                  VPCZoneIdentifier=[Select(i, Ref(self.instance_subnets))],
                  Tags=[
                      Tag("Name", Join("-", [Ref(self.resource_name),  Ref(self.env_tag), Ref(self.vpc_short_name), "pdx"]), True),
                      Tag("Name", "XXXX", True),
                      Tag("Service", Ref(self.service_tag), True),
                      Tag("Environment", Ref(self.env_tag), True),
                      Tag("Address", Ref(self.address_tag), True)
                  ],
  
          NotificationConfigurations=[
              NotificationConfigurations(
                  TopicARN=GetAtt(email_topic, "Arn"),
                  NotificationTypes=[
                      'autoscaling:EC2_INSTANCE_LAUNCH',
                      'autoscaling:EC2_INSTANCE_LAUNCH_ERROR',
                      'autoscaling:EC2_INSTANCE_TERMINATE',
                      'autoscaling:EC2_INSTANCE_TERMINATE_ERROR',
                      ],
                  ),
              ],
      ))
  </code></pre>
  
  <p>I have pulled out the ARN of the topic and given as a value to the "TopicARN" of NotificationConfigurations in an ASG but this code  doesn't output a CF template. Am I missing anything here or Is there a better way to achieve this?</p>
  
  <p>Appreciate your help in advance!</p>
  
  <p>Thanks!</p>