Skip to content

Instantly share code, notes, and snippets.

@nissshh
Forked from jeffbrl/user-data.yaml
Created January 6, 2022 18:00
Show Gist options
  • Save nissshh/7488012847505ad9a4b6de299f2ca5df to your computer and use it in GitHub Desktop.
Save nissshh/7488012847505ad9a4b6de299f2ca5df 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