Question

I'm trying to install a custom compiled package that I have in S3 as a zip file. I added this on my Cloudformation template:

"sources" : {
    "/opt" : "https://s3.amazonaws.com/mybucket/installers/myapp-3.2.1.zip"
},

It downloads and unzip it on /opt without issues, but all the "executables" files don't have the "x" permission. I mean "-rw-r--r-- 1 root root 220378 Dec 4 18:23 myapp".

If I download the zip and unzip it in any directory, the permissions are Ok.

I already read the Cloudformation documentation and there is no clue there.

Someone can help me figuring this out? Thanks in advance.

Was it helpful?

Solution

Maybe you can combine a "configSets" (to guarantee the execution order) and a "command" element to write something like :

"AWS::CloudFormation::Init" : {
    "configSets" : {
        "default" : [ "download", "fixPermissions" ]
    },
    "download" : {
        "sources" : {
            "/opt" : "https://s3.amazonaws.com/mybucket/installers/myapp-3.2.1.zip"
        },
    },
    "fixPermissions" : {
        "commands" : {
            "fixMyAppPermissions" : {
                "command" : "chmod +x /opt/myapp-3.2.1/myapp"
            }
        }
    }
}

Source :

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top