티스토리 뷰

개발/AWS

aws eb security group설정파일

KyeongRok Kim 2019. 1. 8. 14:57

aws eb에 sg설정을 따로 해주어야 한다. 왜냐하면 eb를 재부팅하면 sg를 지우고 다시 만들기 때문이다.


아래 파일을 main/ebextensions에 넣으면 된다.


securitygroup.config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
###################################################################################################
#### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
####
#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#### except in compliance with the License. A copy of the License is located at
####
####     http://aws.amazon.com/apache2.0/
####
#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#### License for the specific language governing permissions and limitations under the License.
###################################################################################################
 
###################################################################################################
#### This configuration file configures ingress rules to the instance's and ELB security group.
#### This will override existing configuration of the Security Groups for both the instance and the
#### ELB. The configuration below allows 80 and 443 to the ELB and port 80 from the ELB to the
#### instances.
###################################################################################################
 
###################################################################################################
#### Allow 123 (UDP) for NTP Server
#### Allow 4118 ~ 4122 For Deep Security
###################################################################################################
 
Resources:
    AWSEBSecurityGroup:
        Type: AWS::EC2::SecurityGroup
        Properties:
            GroupDescription: EB SecurityGroup for ElasticBeanstalk environment.
            SecurityGroupEgress:
                - FromPort: 80
                  ToPort: 80
                  IpProtocol: tcp
                  CidrIp : 0.0.0.0/0
                - FromPort: 443
                  ToPort: 443
                  IpProtocol: tcp
                  CidrIp : 0.0.0.0/0
                - FromPort: 4118
                  ToPort: 4122
                  IpProtocol: tcp
                  CidrIp : 0.0.0.0/0
                - FromPort: 123
                  ToPort: 123
                  IpProtocol: udp
                  CidrIp : 0.0.0.0/0
                - FromPort: 3306
                  ToPort: 3306
                  IpProtocol: tcp
                  CidrIp : 0.0.0.0/0
cs


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함