Skip to content

Instantly share code, notes, and snippets.

@jeffbrl
Created October 21, 2018 00:04
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jeffbrl/abfd84d8d8586495632ba9b8489322e2 to your computer and use it in GitHub Desktop.
Save jeffbrl/abfd84d8d8586495632ba9b8489322e2 to your computer and use it in GitHub Desktop.
AWS CloudFormation UserData Example
# This example is from https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html.
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets wordpress_install --region ${AWS::Region}
/opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment