Skip to content

Instantly share code, notes, and snippets.

@si3mshady
Forked from jeffbrl/user-data.yaml
Created June 18, 2021 05:28
Show Gist options
  • Save si3mshady/84171af5980f1847af9a95a6fd71c142 to your computer and use it in GitHub Desktop.
Save si3mshady/84171af5980f1847af9a95a6fd71c142 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