1

I'm trying to use AWS Cloud Formation template with cfn-signal in Cent OS 7. As per documentation, it is mentioned to install using

yum install -y aws-cfn-bootstrap
or using RPM..

But, none of them helps and just getting the following error message..

No package aws-cfn-bootstrap available.

Santosh Kumar Arjunan
  • 3,600
  • 3
  • 23
  • 24

3 Answers3

7

Great, found some useful information from forum.. Then, tried the following in CentOS 7 as a sudo user.

yum update -y
yum install -y epel-release
yum install -y https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm
ln -s /usr/local/lib/python2.7/site-packages/cfnbootstrap /usr/lib/python2.7/site-packages/cfnbootstrap
ls /opt/aws/bin/

Now, I'm able to notice it installed successfully at /opt/aws/bin/

enter image description here

Santosh Kumar Arjunan
  • 3,600
  • 3
  • 23
  • 24
2

You should try this:

rpm -Uvh https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm

Or

  1. You can also download the file:

https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz

  1. Extract it: tar -xzvf aws-cfn-bootstrap-latest.tar.gz

Also, for detailed steps try, AWS forum's solutions: https://forums.aws.amazon.com/thread.jspa?messageID=599647

Ashutosh
  • 518
  • 7
  • 20
0

This is my current (WORKING!) user data section which gets aws-cfn-bootstrap setup in Centos7.

Properties:
  UserData:
    'Fn::Base64':
      !Sub |
       #!/bin/bash
       yum -y update
       yum -y install wget
       yum -y --enablerepo=extras install epel-release
       yum -y install python-pip
       pip install pystache argparse python-daemon requests
       cd /opt
       curl -O https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz
       curl -O https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm
       tar -xvpf aws-cfn-bootstrap-latest.tar.gz
       cd aws-cfn-bootstrap-1.4/
       python setup.py build
       python setup.py install
       ln -s /usr/init/redhat/cfn-hup /etc/init.d/cfn-hup
       chmod 775 /usr/init/redhat/cfn-hup
       mkdir /opt/aws
       mkdir /opt/aws/bin
       ln -s /usr/bin/cfn-hup /opt/aws/bin/cfn-hup
       set -o errexit
       /usr/bin/cfn-init -v --stack ${AWS::StackName} --resource EC2Instance --region ${AWS::Region}
       /usr/bin/cfn-signal --exit-code $? --stack ${AWS::StackName} --resource EC2Instance --region ${AWS::Region}

Cheers and Good luck!