Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Created March 5, 2020 11:17
Show Gist options
  • Save AndrewBestbier/1c645496faaedcebf6e85e1d4e245ac6 to your computer and use it in GitHub Desktop.
Save AndrewBestbier/1c645496faaedcebf6e85e1d4e245ac6 to your computer and use it in GitHub Desktop.
AppLaunchConfig: # (2)
Type: AWS::AutoScaling::LaunchConfiguration # (2)
Properties:
ImageId: ami-0389b2a3c4948b1a0
InstanceType: t2.micro
SecurityGroups:
- !Ref InstanceSecurityGroup
UserData:
Fn::Base64:
Fn::Sub: |
#!/bin/bash -xe
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "Hello from $(hostname -f)" > /var/www/html/index.html
AutoScalingGroup: # (3)
Type: AWS::AutoScaling::AutoScalingGroup # (3)
Properties:
LaunchConfigurationName: !Ref AppLaunchConfig # (3)
AvailabilityZones: # (3)
- !Select [0, !GetAZs ]
- !Select [1, !GetAZs ]
DesiredCapacity: 3 # (3)
MinSize: 3
MaxSize: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment