【问题标题】:RDS Security Groups Ingress ruleRDS 安全组入口规则
【发布时间】:2016-08-24 02:20:01
【问题描述】:
【问题讨论】:
标签:
amazon-rds
amazon-cloudformation
aws-security-group
【解决方案1】:
来自Working with DB Security Groups:
数据库安全组控制对不在 VPC 内的数据库实例的网络访问。
如果您使用的是 VPC(除非您多年前进行系统设置,否则应该始终如此),您应该使用 AWS::EC2::SecurityGroup 来控制安全性。它做你想要的属性,例如:
"InstanceSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Allow http to client host",
"VpcId" : {"Ref" : "myVPC"},
"SecurityGroupIngress" : [{
"IpProtocol" : "tcp",
"FromPort" : "80",
"ToPort" : "80",
"CidrIp" : "0.0.0.0/0"
}],
"SecurityGroupEgress" : [{
"IpProtocol" : "tcp",
"FromPort" : "80",
"ToPort" : "80",
"CidrIp" : "0.0.0.0/0"
}]
}
}