Вопрос

I am having trouble getting the update procedure to fire with cloudformation. I am following the example from http://blog.kloud.com.au/2013/08/19/bootstrap-update/. I cannot seem to get the update script to fire.

 "c:\\cfn\\hooks.d\\cfn-auto-reloader.conf" : {
        "content": { "Fn::Join" : ["", [
        "[cfn-auto-reloader-hook]\n",
        "triggers=post.update\n",
"path=Resources.WindowsServer.Metadata.AWS::CloudFormation::Init\n",
        "action=",
        "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File c:\\cfn\\deployment\\install.ps1\n"
    ]]}
},

I am trying to get the powershell script to fire when the update procedure is executed, but the log is not showing anything at all, so it seem like it is not triggering.

https://s3.amazonaws.com/Sample-Aspnet-Bootstrap/windows-server.json

Это было полезно?

Решение

The problem was the update was not executing because it did not notice a change in the build. I created a simple build.txt file that held the build number. It is a little different from the example in the blog that is referenced, I created an actual file rather than just changing the metadata. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-hup.html

"AWS::CloudFormation::Init" : {
     "config" : {
        "files" : {
            "c:\\cfn\\build.txt": {
                "content" : { "Fn::Join" : ["", [
                    { "Ref" : "BuildNumber" } ]]}
             },
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top