Created
June 8, 2020 04:44
-
-
Save vinhlee95/d125be62a3228cec8c60d5578287a050 to your computer and use it in GitHub Desktop.
This file contains 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
Resources: | |
MyInstance: | |
Type: AWS::EC2::Instance | |
Properties: | |
AvailabilityZone: "eu-north-1a" | |
ImageId: "ami-0c5254b956817b326" | |
InstanceType: "t3.micro" | |
KeyName: "ec2-general" | |
SecurityGroups: | |
- !Ref HTTPSecurityGroup | |
- !Ref SSHSecurityGroup | |
# Elastic IP for the instance | |
MyEIP: | |
Type: AWS::EC2::EIP | |
Properties: | |
InstanceId: !Ref MyInstance | |
SSHSecurityGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupName: SSHSecurityGroupStack | |
GroupDescription: Enable SSH access to instances via port 22 | |
SecurityGroupIngress: | |
- CidrIp: 0.0.0.0/0 | |
FromPort: 22 | |
IpProtocol: tcp | |
ToPort: 22 | |
HTTPSecurityGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupName: EC2CFHTTPGroup | |
GroupDescription: Allow HTTP traffics to instance in port 80 | |
SecurityGroupIngress: | |
- CidrIp: 0.0.0.0/0 | |
FromPort: 80 | |
IpProtocol: tcp | |
ToPort: 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment