2 ms·
They even embedded a JSON-based programming language! From the example at https://s3.amazonaws.com/cloudformation-templates/CloudFormationSample_WordPress.templ
by aristidb 16y ago
They even embedded a JSON-based programming language! From the example at https://s3.amazonaws.com/cloudformation-templates/CloudFormationSample_WordPress.template https://s3.amazonaws.com/cloudformation-templates/CloudForma...:
"UserData" : { "Fn::Base64" : { "Fn::Join" : [ "\n", [ { "Fn::Join" : [ "=", [ "dbName", { "Ref" : "WordPressDBName" } ] ] }, { "Fn::Join" : [ "=", [ "dbUser", { "Ref" : "WordPressUser" } ] ] }, { "Fn::Join" : [ "=", [ "dbPassword", { "Ref" : "WordPressPwd" } ] ] }, { "Fn::Join" : [ "=", [ "dbHost", { "Fn::GetAtt" : [ "WordPressDB" , "Endpoint.Address" ] } ] ] }, { "Fn::Join" : [ "=", [ "dnsName", { "Fn::GetAtt" : [ "WordPressELB" , "DNSName" ] } ] ] } ] ] } }
Certainly not the nicest syntax, but I guess it gets the job done.
- deleted 16y ago[deleted]
- wrs 16y agoUgh. The first thing I'd do is write a preprocessor so I never have to see anything like that. Why not UserData: Base64("dbName=$WordPressDBName\ndbUser=$WordPressUser\n...") I'll give Amazon the benefit of the doubt and assume they just didn't want to impose a syntax, not that they think humans should be writing JSON like that.