Bootstrapping Applications using AWS CloudFormation

Developer Tools>Bootstrapping Applications using AWS CloudFormation
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

If you are installing and configuring your applications on EC2 dynamically at instance launch time, you will typically need to pull and install packages, deploy files and ensure services are started. AWS CloudFormation provides a set of helper scripts that, in conjunction with resource metadata defined in the template, can be used to install software and start services when you build your stack.

Details

Submitted By: ChrisW@AWS
AWS Products Used: AWS CloudFormation
Language(s): AWS CloudFormation Template
Created On: September 30, 2011 5:44 AM GMT
Last Updated: December 11, 2012 6:10 AM GMT
For more details of using AWS CloudFormation to install and configure application, for more details see:

Change history:

  • 12/10/2012: Fixed issue preventing downloads with Content-Encoding: gzip from being properly expanded. Added Windows 64-bit support. Added support for managing Windows services. Added cfn-hup as a Windows service.
  • 09/19/2012: Updated to support non-IAM use of helper scripts
  • 04/12/2012: Added Windows support for all features including MSI package manager support
  • 02/14/2012: Added support for files from private (authenticated) locations, exec, provisioning OS users/group and config sets

AWS CloudFormation provides the following helpers to allow you to deploy your application code or application and OS configuration at the time you launch your EC2 instances:

  • cfn-init: Used to retrieve and interpret the resource metadata, installing packages, creating files and starting services.
  • cfn-signal: A simple wrapper to signal a CloudFormation WaitCondition allowing you to synchronize other resources in the stack with the application being ready.
  • cfn-get-metadata: A wrapper script making it easy to retrieve either all metadata defined for a resource or path to a specific key or subtree of the resource metadata.
  • cfn-hup: A daemon to check for updates to metadata and execute custom hooks when the changes are detected.

These scripts are installed by default on the latest Amazon Linux AMI in /opt/aws/bin. They are also available in the Amazon Linux AMI yum repository for previous versions of the Amazon Linux AMI as well as via RPM for other Linux/Unix distributions. The scripts can also be installed on Microsoft Windows using Python for Windows.

  • The AWS helper scripts are available in the Amazon Linux AMI yum repository (the package name is aws-cfn-bootstrap) for previous versions of the Amazon Linux AMI.
  • The RPM package for the Amazon Linux AMI is also available here.
  • A source RPM package is available for other Linux distributions here.
  • A Python easy-install package is available here.
  • A ZIP archive is available here.
  • Windows MSI file is available for 32bit Windows and 64bit Windows. To deploy to Windows, you also need to download the Microsoft Visual C++ 2008 Redistributable Package from here
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.