xdc 5 жил өмнө
parent
commit
95ec4ea420
1 өөрчлөгдсөн 31 нэмэгдсэн , 22 устгасан
  1. 31 22
      vpc.yaml

+ 31 - 22
vpc.yaml

@@ -250,16 +250,19 @@ Resources:
   pubgroup:
     Type: 'AWS::EC2::SecurityGroup'
     Properties:
-      GroupDescription: pubgroup
-      GroupName: pubgroup
+      GroupDescription: sg_elb
+      GroupName: sg_elb
       Tags:
         - Key: Name
-          Value: pubgroup
+          Value: sg-elb
+      SecurityGroupIngress:
+        - IpProtocol: tcp
+          FromPort: 80
+          ToPort: 80
+          CidrIp: 0.0.0.0/0
       SecurityGroupEgress:
         - CidrIp: 0.0.0.0/0
-          FromPort: '80'
-          IpProtocol: tcp
-          ToPort: '80'
+          IpProtocol: '-1'
       VpcId: !Ref vpc1
     Metadata:
       'AWS::CloudFormation::Designer':
@@ -267,16 +270,19 @@ Resources:
   webgroup:
     Type: 'AWS::EC2::SecurityGroup'
     Properties:
-      GroupDescription: webgroup
-      GroupName: sg_elb
+      GroupDescription: sg_server
+      GroupName: sg_server
       Tags:
         - Key: Name
-          Value: sg_elb
+          Value: sg_server
+      SecurityGroupIngress:
+        - IpProtocol: tcp
+          FromPort: 7777
+          ToPort: 7777
+          CidrIp: 0.0.0.0/0
       SecurityGroupEgress:
-        - DestinationSecurityGroupId: !Ref pubgroup
-          FromPort: '80'
-          ToPort: '80'
-          IpProtocol: tcp
+        - CidrIp: 0.0.0.0/0
+          IpProtocol: '-1'
       VpcId: !Ref vpc1
     Metadata:
       'AWS::CloudFormation::Designer':
@@ -289,19 +295,22 @@ Resources:
       Tags:
         - Key: Name
           Value: elasticache_memcache
-      SecurityGroupEgress:
-        - DestinationSecurityGroupId: !Ref webgroup
-          FromPort: '5432'
-          ToPort: '5432'
+      SecurityGroupIngress:
+        - SourceSecurityGroupId: !Ref webgroup
+          FromPort: !Ref cacheport
+          ToPort: !Ref cacheport
           IpProtocol: tcp
-        - DestinationSecurityGroupId: !Ref webgroup
+        - SourceSecurityGroupId: !Ref webgroup
           FromPort: '2049'
-          ToPort: '2049'  
+          ToPort: '2049'
           IpProtocol: tcp
-        - DestinationSecurityGroupId: !Ref webgroup
-          FromPort: !Ref cacheport
-          ToPort: !Ref cacheport
+        - SourceSecurityGroupId: !Ref webgroup
+          FromPort: '5432'
+          ToPort: '5432'
           IpProtocol: tcp
+      SecurityGroupEgress:
+        - CidrIp: 0.0.0.0/0
+          IpProtocol: '-1'
       VpcId: !Ref vpc1
     Metadata:
       'AWS::CloudFormation::Designer':