<s> from troposphere import ( <EOL> GetAtt , Join , Output , <EOL> Parameter , Ref , Template , FindInMap <EOL> ) <EOL> from troposphere . elasticbeanstalk import ( <EOL> Application , ApplicationVersion , ConfigurationTemplate , Environment , <EOL> SourceBundle , OptionSettings <EOL> ) <EOL> from troposphere . iam import Role , InstanceProfile <EOL> from troposphere . iam import PolicyType as IAMPolicy <EOL> from awacs . aws import Allow , Statement , Action , Principal , Policy <EOL> from awacs . sts import AssumeRole <EOL> t = Template ( ) <EOL> t . add_version ( ) <EOL> t . add_description ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> keyname = t . add_parameter ( Parameter ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> Type = "<STR_LIT>" , <EOL> ConstraintDescription = "<STR_LIT>" <EOL> ) ) <EOL> t . add_mapping ( "<STR_LIT>" , { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> } <EOL> ) <EOL> t . add_resource ( Role ( <EOL> "<STR_LIT>" , <EOL> AssumeRolePolicyDocument = Policy ( <EOL> Statement = [ <EOL> Statement ( <EOL> Effect = Allow , Action = [ AssumeRole ] , <EOL> Principal = Principal ( <EOL> "<STR_LIT>" , [ <EOL> FindInMap ( <EOL> "<STR_LIT>" , <EOL> Ref ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> ] <EOL> ) <EOL> ) <EOL> ] <EOL> ) , <EOL> Path = "<STR_LIT:/>" <EOL> ) ) <EOL> t . add_resource ( IAMPolicy ( <EOL> "<STR_LIT>" , <EOL> PolicyName = "<STR_LIT>" , <EOL> PolicyDocument = Policy ( <EOL> Statement = [ <EOL> Statement ( Effect = Allow , NotAction = Action ( "<STR_LIT>" , "<STR_LIT:*>" ) , <EOL> Resource = [ "<STR_LIT:*>" ] ) <EOL> ] <EOL> ) , <EOL> Roles = [ Ref ( "<STR_LIT>" ) ] <EOL> ) ) <EOL> t . add_resource ( InstanceProfile ( <EOL> "<STR_LIT>" , <EOL> Path = "<STR_LIT:/>" , <EOL> Roles = [ Ref ( "<STR_LIT>" ) ] <EOL> ) ) <EOL> t . add_resource ( Application ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" <EOL> ) ) <EOL> t . add_resource ( ApplicationVersion ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> ApplicationName = Ref ( "<STR_LIT>" ) , <EOL> SourceBundle = SourceBundle ( <EOL> S3Bucket = Join ( "<STR_LIT:->" , [ "<STR_LIT>" , Ref ( "<STR_LIT>" ) ] ) , <EOL> S3Key = "<STR_LIT>" <EOL> ) <EOL> ) ) <EOL> t . add_resource ( ConfigurationTemplate ( <EOL> "<STR_LIT>" , <EOL> ApplicationName = Ref ( "<STR_LIT>" ) , <EOL> Description = "<STR_LIT>" , <EOL> SolutionStackName = "<STR_LIT>" , <EOL> OptionSettings = [ <EOL> OptionSettings ( <EOL> Namespace = "<STR_LIT>" , <EOL> OptionName = "<STR_LIT>" , <EOL> Value = Ref ( "<STR_LIT>" ) <EOL> ) , <EOL> OptionSettings ( <EOL> Namespace = "<STR_LIT>" , <EOL> OptionName = "<STR_LIT>" , <EOL> Value = Ref ( "<STR_LIT>" ) <EOL> ) <EOL> ] <EOL> ) ) <EOL> t . add_resource ( Environment ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> ApplicationName = Ref ( "<STR_LIT>" ) , <EOL> TemplateName = Ref ( "<STR_LIT>" ) , <EOL> VersionLabel = Ref ( "<STR_LIT>" ) <EOL> ) ) <EOL> t . add_output ( <EOL> Output ( <EOL> "<STR_LIT>" , <EOL> Description = "<STR_LIT>" , <EOL> Value = Join ( "<STR_LIT>" , [ "<STR_LIT>" , GetAtt ( "<STR_LIT>" , "<STR_LIT>" ) ] ) <EOL> ) <EOL> ) <EOL> print ( t . to_json ( ) ) </s>
