Skip to content

Instantly share code, notes, and snippets.

@mandeepbal
Created May 16, 2019 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mandeepbal/6ebf0d8be94d4512577a523d13ee8aa4 to your computer and use it in GitHub Desktop.
Save mandeepbal/6ebf0d8be94d4512577a523d13ee8aa4 to your computer and use it in GitHub Desktop.
Cloudformation Launch Config - send user-data to aws system log
Resources:
LaunchConfig:
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
IamInstanceProfile: !FindInMap [ EnvironmentMap, !Ref ParamEnvironment, InstanceProfile ]
ImageId: !Ref ParamInstanceAMI
InstanceType: !FindInMap [ EnvironmentMap, !Ref ParamEnvironment, InstanceType ]
SecurityGroups: !FindInMap [EnvironmentMap, !Ref ParamEnvironment, SecurityGroups]
UserData:
Fn::Base64: !Sub
- |
#!/bin/bash -x
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
echo "Test "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment