Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Last active March 5, 2020 12:12
Show Gist options
  • Select an option

  • Save AndrewBestbier/ab04ba622e22baa64a4cfcddac6e5b80 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewBestbier/ab04ba622e22baa64a4cfcddac6e5b80 to your computer and use it in GitHub Desktop.
AppLaunchConfig: # (1)
Type: AWS::AutoScaling::LaunchConfiguration # (2)
Properties:
ImageId: ami-0389b2a3c4948b1a0
InstanceType: t2.micro
SecurityGroups:
- !Ref InstanceSecurityGroup
AssociatePublicIpAddress: true
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 # (4)
Properties:
LaunchConfigurationName: !Ref AppLaunchConfig # (5)
AvailabilityZones: # (6)
- !Select [0, !GetAZs ]
- !Select [1, !GetAZs ]
DesiredCapacity: 3 # (7)
MinSize: 3
MaxSize: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment