Where is the cfnbootstrap folder?

Question:

I’m curious about some AWS internals – I don’t have an actual issue, I just want to learn more about this.

I’m running Beanstalk with Windows instances.

I was poking around some logs in c:cfn and in "C:cfnlogcfn-init.log" and I found some lines like this:

  File "cfnbootstraputil.pyc", line 159, in _retry
  File "cfnbootstrapmsi_tool.pyc", line 100, in _msi_from_url
  File "cfnbootstraputil.pyc", line 79, in __init__
  File "cfnbootstraputil.pyc", line 573, in check_status
  File "cfnbootstrappackagesrequestsmodels.pyc", line 834, in raise_for_status

So I searched the server’s HDD and found no cfnbootstrap folder or any *.pyc files.

Where is this folder and these Python scripts located? I’d like to have a look at these scripts (maybe even try to decompile the pyc files) and see what it’s actually doing.

Edit

So it’s a Python module, but it seems Python isn’t installed on my Beanstalk Windows instance (or at least I can’t find it anywhere). Does Beanstalk not even use this for Windows?

Asked By: red888

||

Answers:

cfnbootstrap is a Python package containing various CloudFormation helper scripts.

The latest version of the Amazon Linux AMI has the AWS CloudFormation helper scripts installed by default in /opt/aws/bin, and the underlying cfnbootstrap Python package can be found in the OS Python shared packages directory at /usr/lib/python2.7/dist-packages/cfnbootstrap/.

On Windows-based Elastic Beanstalk instances, the cfn-bootstrap MSI package gets installed to to C:Program FilesAmazoncfn-bootstrap. For the MSI package the Python files are compiled into self-contained .exe files using py2exe, so a global Python installation is not required on the instance, and all of the Python source files are contained in library.zip in the package directory.

See the CloudFormation Helper Scripts Reference documentation for more information on this package.

Answered By: wjordan