File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 1+ ---
2+ Parameters :
3+ SecurityGroupDescription :
4+ Description : Security Group Description
5+ Type : String
6+
7+ Resources :
8+ MyInstance :
9+ Type : AWS::EC2::Instance
10+ Properties :
11+ AvailabilityZone : us-east-1d
12+ ImageId : ami-a4c7edb2
13+ InstanceType : t2.micro
14+ SecurityGroups :
15+ - !Ref SSHSecurityGroup
16+ - !Ref ServerSecurityGroup
17+
18+ # an elastic IP for our instance
19+ MyEIP :
20+ Type : AWS::EC2::EIP
21+ Properties :
22+ InstanceId : !Ref MyInstance
23+
24+ # our EC2 security group
25+ SSHSecurityGroup :
26+ Type : AWS::EC2::SecurityGroup
27+ Properties :
28+ GroupDescription : Enable SSH access via port 22
29+ SecurityGroupIngress :
30+ - CidrIp : 0.0.0.0/0
31+ FromPort : 22
32+ IpProtocol : tcp
33+ ToPort : 22
34+
35+ # our second EC2 security group
36+ ServerSecurityGroup :
37+ Type : AWS::EC2::SecurityGroup
38+ Properties :
39+ GroupDescription : !Ref SecurityGroupDescription
40+ SecurityGroupIngress :
41+ - IpProtocol : tcp
42+ FromPort : 80
43+ ToPort : 80
44+ CidrIp : 0.0.0.0/0
45+ - IpProtocol : tcp
46+ FromPort : 22
47+ ToPort : 22
48+ CidrIp : 192.168.1.1/32
You can’t perform that action at this time.
0 commit comments