i need download file during initialisation of windows instance. test this, i'm using following script download google logo (using simplified version of windows roles , features template):
{ "awstemplateformatversion" : "2010-09-09", "description" : "test download.", "resources" : { "instancesecuritygroup" : { "type" : "aws::ec2::securitygroup", "properties" : { "groupdescription" : "enable rdp", "securitygroupingress" : [ {"ipprotocol" : "tcp", "fromport" : "3389", "toport" : "3389", "cidrip" : "0.0.0.0/0"} ] } }, "windowsserver": { "type" : "aws::ec2::instance", "metadata" : { "aws::cloudformation::init" : { "config" : { "files" : { "c:\\test\\google-logo.png" : { "source" : "http://www.google.com/images/srpr/logo4w.png" } } } } }, "properties": { "instancetype" : "m1.small", "imageid" : "ami-bbf2e1cf", "securitygroups" : [ {"ref" : "instancesecuritygroup"} ], "keyname" : "pop", "userdata" : { "fn::base64" : { "fn::join" : ["", [ "<script>\n", "cfn-init.exe -v -s ", { "ref" : "aws::stackid" }, " -r windowsserver", " --region ", { "ref" : "aws::region" }, "\n", "</script>" ]]}} } }, "windowsserverwaithandle" : { "type" : "aws::cloudformation::waitconditionhandle" }, "windowsserverwaitcondition" : { "type" : "aws::cloudformation::waitcondition", "dependson" : "windowsserver", "properties" : { "handle" : {"ref" : "windowsserverwaithandle"}, "timeout" : "1800" } } } } this finishes executing no error... , no file. going wrong?
jonathon,
i tried template , file downloaded me. can check cfn logs on instance. in c:\cfn\log\. cfn-init.log shows:
2013-07-19 21:30:18,269 [debug] parent directory c:\test not exist, creating 2013-07-19 21:30:18,269 [debug] writing content c:\test\google-logo.png 2013-07-19 21:30:18,269 [debug] retrieving contents http://www.google.com/images/srpr/logo4w.png 2013-07-19 21:30:18,316 [debug] no mode specified c:\test\google-logo.png 2013-07-19 21:30:18,316 [warning] unsupported os setting owner/group: nt and cfn-wire.log shows:
2013-07-19 21:30:18,269 [debug] request: http://www.google.com/images/srpr/logo4w.png [headers: {'accept-encoding': 'identity, deflate, compress, gzip', 'accept': '*/*', 'user-agent': 'python-requests/0.11.1'}] 2013-07-19 21:30:18,302 [debug] response: 200 http://www.google.com/images/srpr/logo4w.png [headers: {'content-length': '18946', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'expires': 'fri, 19 jul 2013 21:30:20 gmt', 'server': 'sffe', 'last-modified': 'mon, 25 mar 2013 19:02:15 gmt', 'cache-control': 'private, max-age=31536000', 'date': 'fri, 19 jul 2013 21:30:20 gmt', 'content-type': 'image/png'}]
Comments
Post a Comment