ALIYUN::ECS::SecurityGroupEgress類型用於建立安全性群組出方向的訪問規則。
文法
{
"Type": "ALIYUN::ECS::SecurityGroupEgress",
"Properties": {
"SecurityGroupId": String,
"IpProtocol": String,
"PortRange": String,
"DestGroupId": String,
"DestCidrIp": String,
"Policy": String,
"Priority": String,
"NicType": String,
"DestPrefixListId": String,
"Description": String,
"DestGroupOwnerId": String,
"Ipv6DestCidrIp": String
}
}屬性
| 屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
| IpProtocol | String | 是 | 否 | 傳輸層協議。 | 取值:
|
| PortRange | String | 是 | 否 | 目的端安全性群組開放的傳輸層協議相關的連接埠範圍。 | 取值:
瞭解連接埠的應用情境,請參見常用連接埠。 |
| SecurityGroupId | String | 否 | 否 | 源端安全性群組ID。 | 無 |
| DestPrefixListId | String | 否 | 否 | 需要設定出方向存取權限的目的端首碼列表ID。 | 您可以調用DescribePrefixLists查詢可用的首碼列表ID。 當安全性群組的網路類型為傳統網路時,不支援設定首碼列表。更多資訊,請參見安全性群組使用限制。 當您指定了DestCidrIp、Ipv6DestCidrIp或DestGroupId參數中的任意一個時,將忽略該參數。 |
| NicType | String | 否 | 否 | 網卡類型。 | 取值:
|
| Priority | Integer | 否 | 否 | 安全性群組規則優先順序。 | 取值範圍:1~100。 預設值:1。 |
| DestGroupId | String | 否 | 否 | 需要設定存取權限的目的端安全性群組ID。 | 至少設定DestGroupId或者DestCidrIp其中一項。 如果指定DestGroupId,但未指定DestCidrIp,則NicType取值為intranet。 如果同時指定DestGroupId和DestCidrIp,則以DestCidrIp的設定為準。 |
| DestCidrIp | String | 否 | 否 | 目的端IP位址範圍。 | 支援IPv4格式的IP位址範圍。 |
| Policy | String | 否 | 否 | 設定存取權限。 | 取值:
|
| Description | String | 否 | 是 | 安全性群組規則的描述資訊。 | 長度為1~512個字元。 |
| DestGroupOwnerId | String | 否 | 否 | 跨賬戶設定安全性群組規則時,目的端安全性群組所屬的阿里雲帳號ID。 | 如果DestGroupOwnerId未設定,則認為是設定您其他安全性群組的存取權限。如果您已經設定DestCidrIp,則DestGroupOwnerId的設定無效。 |
| Ipv6DestCidrIp | String | 否 | 否 | 目的端IPv6 CIDR位址區段。 | 支援CIDR格式和IPv6格式的IP位址範圍,且僅支援VPC類型的IP地址。 |
傳回值
Fn::GetAtt
無。
樣本
JSON格式{ "ROSTemplateFormatVersion": "2015-09-01", "Description": "Test ECS SecurityGroupEgress", "Parameters": { "SecurityGroupId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId", "Label": { "zh-cn": "安全性群組ID", "en": "Security Group ID" } } }, "Resources": { "SgEgress": { "Type": "ALIYUN::ECS::SecurityGroupEgress", "Properties": { "IpProtocol": "all", "PortRange": "-1/-1", "NicType": "intranet", "SecurityGroupId": { "Ref": "SecurityGroupId" } } } } }