ALIYUN::ECS::SecurityGroupIngress类型用于创建安全组入方向的访问规则。
语法
{
"Type": "ALIYUN::ECS::SecurityGroupIngress",
"Properties": {
"SourceGroupOwnerId": String,
"Description": String,
"PortRange": String,
"SecurityGroupId": String,
"NicType": String,
"Ipv6SourceCidrIp": String,
"Priority": Integer,
"SourceGroupId": String,
"Policy": String,
"IpProtocol": String,
"SourcePortRange": String,
"SourceCidrIp": String,
"SourcePrefixListId": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
IpProtocol | String | 是 | 否 | IP协议。 | 取值:
|
PortRange | String | 是 | 否 | 目的端安全组开放的传输层协议相关的端口范围。 | 取值:
了解端口的应用场景,请参见典型应用的常用端口。 |
SourcePrefixListId | String | 否 | 否 | 需要设置入方向访问权限的目的端前缀列表ID。 | 您可以调用DescribePrefixLists查询可以使用的前缀列表ID。 安全组的网络类型为经典网络时,不支持设置前缀列表。更多信息,请参见安全组使用限制。 当您指定了SourceCidrIp、Ipv6SourceCidrIp与SourceGroupId参数中的任意一个时,将忽略该参数。 |
SourceGroupId | String | 否 | 否 | 需要设置访问权限的源端安全组ID。 | 至少设置SourceGroupId或者SourceCidrIp其中一项。 如果指定SourceGroupId,但未指定SourceCidrIp,则参数NicType取值为intranet。 如果同时指定SourceGroupId和SourceCidrIp,则默认以SourceCidrIp的设置为准。 |
SecurityGroupId | String | 否 | 否 | 需要创建入规则的安全组ID。 | 无 |
NicType | String | 否 | 否 | 网络类型。 | 取值:
|
Priority | Integer | 否 | 否 | 安全组规则优先级。 | 取值范围:1~100。 默认值:1。 |
SourceCidrIp | String | 否 | 否 | 源端IPv4 CIDR地址段。 | 仅支持IPv4格式的IP地址范围。 |
Policy | String | 否 | 否 | 访问权限。 | 取值:
|
SourceGroupOwnerId | String | 否 | 否 | 跨账户设置安全组规则时,源端安全组所属的阿里云账户ID。 | 如果SourceGroupOwnerId未设置,则默认设置您其他安全组的访问权限。 如果已经设置SourceCidrIp,则SourceGroupOwnerId的设置无效。 |
Description | String | 否 | 是 | 安全组规则的描述信息。 | 长度为1~512个字符。 |
SourcePortRange | String | 否 | 否 | 源端安全组开放的传输层协议相关的端口范围。 | 取值:
|
Ipv6SourceCidrIp | String | 否 | 否 | 源端IPv6 CIDR地址段。 | 支持CIDR格式和IPv6格式的IP地址范围。仅支持VPC类型的IP地址。 |
返回值
Fn::GetAtt
无。
示例
JSON
格式{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "SecurityGroupId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId", "Label": { "zh-cn": "安全组ID", "en": "Security Group ID" } } }, "Resources": { "SecurityGroupIngress": { "Type": "ALIYUN::ECS::SecurityGroupIngress", "Properties": { "SecurityGroupId": { "Ref": "SecurityGroupId" }, "SourceCidrIp": "0.0.0.0/0", "IpProtocol": "all", "NicType": "intranet", "PortRange": "-1/-1" } } } }