Created
March 5, 2020 10:55
-
-
Save AndrewBestbier/92139f8ef8422e70b4bfc8601115fbe8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FirstInstance: | |
| Type: AWS::EC2::Instance | |
| Properties: | |
| ImageId: ami-0389b2a3c4948b1a0 | |
| InstanceType: t2.micro | |
| SecurityGroups: | |
| - !Ref InstanceSecurityGroup # (1) | |
| 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 | |
| InstanceSecurityGroup: # (2) | |
| Type: AWS::EC2::SecurityGroup # (3) | |
| Properties: | |
| GroupDescription: Letting HTTP into our instance | |
| SecurityGroupIngress: | |
| - FromPort: 80 # (4) | |
| ToPort: 80 | |
| CidrIp: 0.0.0.0/0 # (5) | |
| IpProtocol: tcp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment