<s> from troposphere import Base64 , FindInMap , GetAtt <EOL> from troposphere import Parameter , Output , Ref , Template <EOL> import troposphere . ec2 as ec2 <EOL> template = Template ( ) <EOL> keyname_param = template . add_parameter ( Parameter ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> Type = "<STR_LIT>" , <EOL> ) ) <EOL> template . add_mapping ( '<STR_LIT>' , { <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : "<STR_LIT>" } <EOL> } ) <EOL> ec2_instance = template . add_resource ( ec2 . Instance ( <EOL> "<STR_LIT>" , <EOL> ImageId = FindInMap ( "<STR_LIT>" , Ref ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> InstanceType = "<STR_LIT>" , <EOL> KeyName = Ref ( keyname_param ) , <EOL> SecurityGroups = [ "<STR_LIT:default>" ] , <EOL> UserData = Base64 ( "<STR_LIT>" ) <EOL> ) ) <EOL> template . add_output ( [ <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = Ref ( ec2_instance ) , <EOL> ) , <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = GetAtt ( ec2_instance , "<STR_LIT>" ) , <EOL> ) , <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = GetAtt ( ec2_instance , "<STR_LIT>" ) , <EOL> ) , <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = GetAtt ( ec2_instance , "<STR_LIT>" ) , <EOL> ) , <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = GetAtt ( ec2_instance , "<STR_LIT>" ) , <EOL> ) , <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = GetAtt ( ec2_instance , "<STR_LIT>" ) , <EOL> ) , <EOL> ] ) <EOL> print ( template . to_json ( ) ) </s>
