【发布时间】:2022-01-20 17:52:14
【问题描述】:
在以下代码上运行 cfn-lint 时,我收到警告
"MicroserviceSG": {
"Type": "AWS::EC2::SecurityGroup",
⚠ "DependsOn": "MicroserviceLoadBalancerSGPrivate",
"Properties": {
"GroupName": {"Fn::Join": ["-", [{"Ref": "Name"}, {"Ref": "Env"}, "container-sg"]]},
"GroupDescription": "HTTP",
"VpcId": {"Ref": "VpcId"},
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": 80,
"ToPort": 80,
"SourceSecurityGroupId": { "Ref": "MicroserviceLoadBalancerSGPrivate" }
}
]
}
},
W3005 Obsolete DependsOn on resource (MicroserviceLoadBalancerSGPrivate),
dependency already enforced by a "Ref" at
Resources/MicroserviceSG/Properties/SecurityGroupIngress/0/SourceSecurityGroupId/Ref
这个警告有效吗?某些对象引用会执行隐式依赖检查吗?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation