想要将多个 CIDRip 添加到我的数据库安全组错误:
CidrIp=Ref(AppSecurityGroup)),
TypeError: __init__() takes at least 2 arguments (1 given)
我认为这很容易,但我被困在这里并且感到困惑。
DBSecurityGroup = t.add_resource(
rds.DBSecurityGroup(
'DBSecurityGroup',
GroupDescription='Enable access on the inbound port',
DBSecurityGroupIngess=[
rds.DBSecurityGroup(
IpProtocol='tcp',
FromPort='3306',
ToPort='3306',
CidrIp=Ref(AppSecurityGroup)),
rds.DBSecurityGroup(
IpProtocol='tcp',
FromPort='3306',
ToPort='3306',
CidrIp=Ref(CalcSecurityGroup)),
rds.DBSecurityGroup(
IpProtocol='tcp',
FromPort='3306',
ToPort='3306',
CidrIp=Ref(CIDRSupport))],
VpcId=Ref(VPC),
Tags=Tags(
Name=Join("", [Ref("AWS::StackName"), "-DB-SG"]),
)
))
现在我需要在端口上入站到 Calc-SG、App-SG 和 CIDRSupport 6379
。
如何在 SG 中定义它?