Created
May 14, 2018 17:38
-
-
Save chriswgerber/1fdb34ca4d293f8c34c1fbca09c5252f to your computer and use it in GitHub Desktop.
Python file demonstrating errors with Troposphere Template Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
from troposphere.template_generator import TemplateGenerator | |
JSON_DATA = """\ | |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Example nested outputs template", | |
"Parameters": { | |
"Ec2Instance1": { | |
"Type": "String", | |
"Description": "Instance 1 ID" | |
}, | |
"Ec2Instance2": { | |
"Type": "String", | |
"Description": "Instance 2 ID" | |
} | |
}, | |
"Resources": { | |
"ElasticLoadBalancer": { | |
"Type": "AWS::ElasticLoadBalancing::LoadBalancer", | |
"Properties": { | |
"AvailabilityZones": { | |
"Fn::GetAZs": "" | |
}, | |
"Instances": [ | |
{ | |
"Ref": "Ec2Instance1" | |
}, | |
{ | |
"Ref": "Ec2Instance2" | |
} | |
], | |
"Listeners": [ | |
{ | |
"LoadBalancerPort": "80", | |
"InstancePort": "80", | |
"Protocol": "HTTP" | |
} | |
], | |
"HealthCheck": { | |
"Target": "HTTP:80/", | |
"HealthyThreshold": "3", | |
"UnhealthyThreshold": "5", | |
"Interval": "30", | |
"Timeout": "5" | |
}, | |
"ConnectionDrainingPolicy": { | |
"Enabled": "true", | |
"Timeout": "60" | |
} | |
} | |
} | |
}, | |
"Outputs": { | |
"LbSecurityGroup": { | |
"Description": "LB Security Group", | |
"Value": { | |
"Fn::GetAtt": [ | |
"ElasticLoadBalancer", | |
"SourceSecurityGroup.GroupName" | |
] | |
}, | |
"Export": { | |
"Name": { | |
"Fn::Sub": "${AWS::StackName}-LbSecurityGroup" | |
} | |
} | |
} | |
} | |
} | |
""" | |
JSON_TEMPLATE = json.loads(JSON_DATA) | |
TEMPLATE = TemplateGenerator(JSON_TEMPLATE) | |
TEMPLATE.to_json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
troposphere 2.2.1
Error: