gpt4 book ai didi

mysqli - 云信息 : Why does RDS instance creates default security group when i am already creating one while initating RDS?

转载 作者:行者123 更新时间:2023-12-03 07:45:38 24 4
gpt4 key购买 nike

这是我的 RDS 实例,我正在创建一个安全组,可以访问我的工作台和后端代码。 RDS 创建默认安全组,该安全组与我创建的安全组重叠,因此无法访问。如何停止 RDS 创建默认安全组。

这是我的 RDS 模板

"Resources": {
"epmoliteDB": {
"Type": "AWS::RDS::DBInstance",
"Properties": {
"DBName": {"Ref": "DBname"},
"DBSecurityGroups": [{"Ref": "DBSecurityGroup"}],
"AllocatedStorage": "5",
"DBInstanceClass": "db.t2.micro",
"Engine": "MySQL",
"MasterUsername": {"Ref": "DBuser"},
"MasterUserPassword": {"Ref": "DBpass"},
"DBParameterGroupName": {"Ref": "epmoliteDBParameterGroup"}
}
},

"DBSecurityGroup": {
"Type": "AWS::RDS::DBSecurityGroup",
"Properties": {
"DBSecurityGroupIngress": {
"EC2SecurityGroupName": {"Ref": "WebServerSecurityGroup"}
},
"GroupDescription": "Frontend Access"
}
},

"WebServerSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription" : "Enable MYSQL access via port 3306",
"SecurityGroupIngress": [{
"IpProtocol": "tcp","FromPort": "3306","ToPort": "3306","CidrIp": "0.0.0.0/0"
}]
}
},

"epmoliteDBParameterGroup": {
"Type": "AWS::RDS::DBParameterGroup",
"Properties" : {
"Description" : "Parameter group to avoid schema import errors",
"Family" : "MySQL5.7",
"Parameters" : {
"log_bin_trust_function_creators": "1"
}
}
}

}

最佳答案

我无法准确解释为什么创建默认安全组并与您指定的安全组重叠。不过,我可以告诉您的是,您确实应该依赖 VPCSecurityGroups,它取代了与“EC2 Classic”(VPC 时代之前)相关的旧 DBSecurityGroups。也许这会解决问题。

文档中有一篇文章可以了解更多相关信息:http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html#Overview.RDSSecurityGroups.Compare .

关于mysqli - 云信息 : Why does RDS instance creates default security group when i am already creating one while initating RDS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46330945/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com