2013-07-19 5 views
1

Windows 인스턴스를 초기화하는 동안 파일을 다운로드해야합니다. 나는합니다 (Windows Roles and Features template의 단순화 된 버전을 사용) Google 로고를 다운로드하려면 다음 스크립트를 사용하고이를 테스트하려면 :이 오류없이 실행하지 ... 그리고 어떤 파일이 완료CloudFormation 스크립트에서 파일을 다운로드하지 않는 이유는 무엇입니까?

{ 
    "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" 
     } 
    } 
    } 
} 

. 내가 어디로 잘못 가고 있니?

답변

1

조나단,

템플릿을 시험해보고 파일을 다운로드했습니다. 인스턴스의 cfn 로그를 확인할 수 있습니다. 그들은 c:\cfn\log\에 있습니다. 내 CFN-init.log 쇼 :

2013-07-19 21:30:18,269 [DEBUG] Parent directory c:\test does not exist, creating 
2013-07-19 21:30:18,269 [DEBUG] Writing content to c:\test\google-logo.png 
2013-07-19 21:30:18,269 [DEBUG] Retrieving contents from http://www.google.com/images/srpr/logo4w.png 
2013-07-19 21:30:18,316 [DEBUG] No mode specified for c:\test\google-logo.png 
2013-07-19 21:30:18,316 [WARNING] Unsupported OS for setting owner/group: nt 

그리고 내 CFN-wire.log 쇼 :

2013-07-19 21:30:18,269 [DEBUG] Request: GET 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'}] 
+0

너무 나를 위해 일한 직후 - 기괴한. 확인할 시간을내어 주셔서 감사합니다. – Jonathan

관련 문제