amazon-web-services - 遇到不受支持的属性 SourceSecurityGroupId
问题描述
我正在尝试为创建 RDS 的 AWS::CloudFormation 构建模板。但是当我尝试启动模型时,我得到一个Encountered unsupported property SourceSecurityGroupId
.
我使用此参数来获取安全组 ID
"WebServerSecurityGroupId": {
"Type": "AWS::EC2::SecurityGroup::Id",
}
我使用的资源:
"Resources": {
"DBVPCSecurityGroup" : {
"Type": "AWS::EC2::SecurityGroup",
"Properties" : {
"VpcId" : { "Ref" : "VpcId" },
"SecurityGroupIngress" : [
{
"IpProtocol" : "tcp",
"FromPort" : "80",
"ToPort" : "80",
"SourceSecurityGroupId:" : {
"Ref": "WebServerSecurityGroupId"
}
}
]
}
},
// the rest of template
解决方案
其实看起来不错。您能否尝试将安全组与 Ingress 分开:
"DBVPCSecurityGroup" : {
"Type": "AWS::EC2::SecurityGroup",
"Properties" : {
"VpcId" : { "Ref" : "VpcId" }
}
},
"WebServerSecurityHTTPIn": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "DBVPCSecurityGroup"
},
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"SourceSecurityGroupId": {
"Ref": "WebServerSecurityGroupId"
}
}
},
推荐阅读
- sharepoint - 全局 SharePoint JS 链接文件引用
- android - 图像的动态高度查看器(onMeasure()不起作用)
- log4j2 - 使用 Log4j2 生成的日志归档的名称
- com - 如何为未实现 IDispatch 接口的 COM 对象添加调度?
- python - Python:检测是否只有一个给定的单词出现在文本文件中
- sql-server - SQL查询中按时间段进行日期组合的问题
- php - PHP 5.3 Zend - 看不到方法是如何被调用的
- c++ - std::isgraph 断言,如何解决?
- c# - 使用 Mimekit 验证数字签名失败
- javascript - 价格乘以数量输出jquery