Bootstrap AWS ec2 with CloudFormation and Docker
The host is requried to have docker installed. This can be done
UserData either through
cloud-init or a shell script.
Once docker is available this image can be run with:
docker run \ -v /var/run/docker.sock:/var/run/docker.sock -e [AWS_DEFAULT_REGION=] -e [CFN_METADATA_RESOURCE=] -e ... sungardas/aws-cfn-bootstrap
The container will interface with CloudFormation, can access
CloudFormation Metadata and is able to respond to a
Useful for implementations that only run Docker containers and for
minimal operating systems like
AWS::CloudFormation::Init can contain run
docker which is linked
to the host. Images will be pulled and run by the host docker engine.
This project creates tags for different versions of docker. Use a tag
that matches the version of docker the host is running.
sungardas/aws-cfn-bootstrap:1.9 sungardas/aws-cfn-bootstrap:1.10 sungardas/aws-cfn-bootstrap:1.11 sungardas/aws-cfn-bootstrap:1.12
AWS_DEFAULT_REGION - The AWS region to run against.
CFN_CONFIG_SETS - List of config sets to run.
CFN_METADATA_RESOURCE - The resource containing
CFN_NOTIFY_RESOURCE - The resource to send notification to when
complete. Usually one with
CFN_STACK_NAME - The name of the CloudFormation Stack
ECR_REGISTRY_IDS - If set, will run
aws ecr get-login and populate
the host docker engine with credentials for ECR. Recommened to use with
an ec2 instance profile.
Inspired by docker-aws
Sungard Availability Services | Labs
This project is maintained by the Labs team at Sungard Availability