AdvancedCloudFormation icon indicating copy to clipboard operation
AdvancedCloudFormation copied to clipboard

cfn-bootstrap is no longer valid - easy_install is removed

Open queglay opened this issue 7 years ago • 1 comments

in Ubuntu 18 AMI's the code block given for Ubuntu doesn't appear to be valid anymore because easy_install has been removed from python-setuptools - https://launchpad.net/ubuntu/+source/python-setuptools/39.0.1-2

What would an alternative be to the provided code be for cfn-bootstrap?

"UserData": {
                    "Fn::Base64": { "Fn::Join":["", [
                      "#!/bin/bash -ex\n",
                      "apt-get update\n",
                      "apt-get -y install python-setuptools\n",
                      "mkdir aws-cfn-bootstrap-latest\n",
                      "curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n",
                      "easy_install aws-cfn-bootstrap-latest\n",
                      "/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource DomainMember2", " --configsets configinstance", " --region ", { "Ref": "AWS::Region" }, "\n",
                      "\n",
                      "apt-get update\n"
                    ]]}
                }

queglay avatar Nov 05 '18 11:11 queglay

It seems easy_install wasn't removed. It's just not in the PATH env, apparently (https://askubuntu.com/questions/1040392/easy-install-command-not-found).

The following UserData should work:

"UserData": { "Fn::Base64": { "Fn::Join":["", [ "#!/bin/bash -ex\n", "apt update -y\n", "apt -y install python python-setuptools\n", "python /usr/lib/python2.7/dist-packages/easy_install.py aws-cfn-bootstrap-latest\n", "/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource DomainMember2", " --configsets configinstance", " --region ", { "Ref": "AWS::Region" }, "\n", ]]} }

raonitimo avatar Mar 25 '20 02:03 raonitimo