Created
November 16, 2020 05:38
-
-
Save AHaydar/3c1e79e7bc3c1463b07e7d1e7d7d9fb0 to your computer and use it in GitHub Desktop.
CloudFormation
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: | |
Ec2Instance: | |
Type: AWS::EC2::Instance | |
Properties: | |
InstanceType: t2.micro | |
ImageId: ami-0947d2ba12ee1ff75 # Amazon Linux AMI in us-east-1 | |
KeyName: ec2-instances | |
Tags: | |
- Key: Name | |
Value: My EC2 Instance | |
- Key: Owner | |
Value: Ali | |
SecurityGroups: | |
- !Ref MySecurityGroup | |
MySecurityGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupDescription: Open Ports 22 and 80 | |
SecurityGroupIngress: | |
- IpProtocol: tcp | |
FromPort: '22' | |
ToPort: '22' | |
CidrIp: <your IP>/32 | |
- IpProtocol: tcp | |
FromPort: '80' | |
ToPort: '80' | |
CidrIp: 0.0.0.0/0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment