Last active
November 5, 2021 08:28
-
-
Save kixorz/10194688 to your computer and use it in GitHub Desktop.
Ubuntu CloudFormation Tools installation snippet. Modified version of http://krunchtime.it/setting-up-bootstrapping-using-cfn-init-for-aws-ubuntu-ec2-instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
"\n", | |
"/usr/local/bin/cfn-signal --exit-code $? '", { "Ref" : "WaitHandle" }, "'\n" | |
]]} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got this working on Ubuntu 18. Some small changes. Thanks, everyone here for their notes. They were very helpful in figuring out what was going on. Here's a link. https://gist.github.com/mmasko/66d34b651642525c63cd39251e0c2a8b