-
Notifications
You must be signed in to change notification settings - Fork 2
/
security-stack.yml
53 lines (52 loc) · 1.35 KB
/
security-stack.yml
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
52
53
Description: Create security groups and IAM roles
Parameters:
VPCID:
Type: AWS::EC2::VPC::Id
Description: Enter a valid VPC Id
Resources:
WebDMZSecurityGroup:
Type: 'AWS::EC2::SecurityGroup'
Properties:
GroupName: CloudWebDMZ
GroupDescription: Cloud WebServer DMZ Group
VpcId: !Ref VPCID
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 3306
ToPort: 3306
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 443
ToPort: 443
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 2049
ToPort: 2049
CidrIp: 0.0.0.0/0
RDSSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: RDSSecurityGroup
GroupDescription: RDS Security Group
VpcId: !Ref VPCID
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 3306
ToPort: 3306
SourceSecurityGroupId: !Ref WebDMZSecurityGroup
Outputs:
SecurityGroups:
Value: !Join
- ","
- - !Ref WebDMZSecurityGroup
- !Ref RDSSecurityGroup
Export:
Name: !Sub '${AWS::StackName}-SecurityGroups'