数量限制:
单张弹性网卡关联的所有安全组的规则(包括入方向规则与出方向规则)数量之和不能超过 1000。具体限制请参见
安全组使用限制
。
优先级设置:
安全组入方向规则优先级(Priority)可选范围为 1~100。数字越小,代表优先级越高,优先级相同的安全组规则,优先以拒绝访问(drop)的规则为准。
如果指定的安全组规则已存在,此次调用成功,但不会增加规则。
规则确定方式
确定一条安全组入方向规则必要的一组相关参数:
源端设置:选择 SourceCidrIp(IPv4 地址)、Ipv6SourceCidrIp(IPv6 地址)、SourcetPrefixListId(前缀列表 ID)、SourceGroupId(源端安全组)中的一项。
目的端口范围:PortRange。
协议类型:IpProtocol。
权限策略:Policy。
企业安全组不支持授权其他安全组访问,普通安全组支持授权的安全组数量最多为 20 个。
假设要在杭州地域下指定安全组中增加几条不同源端的入方向规则:
增加指定 IP 地址段的访问权限。
"RegionId":"cn-hangzhou", //设置地域
"SecurityGroupId":"sg-bp67acfmxazb4p****", //设置安全组
"Permissions":[
"SourceCidrIp":"10.0.0.0/8", //设置源端 IPv4 地址
"PortRange":"22/22", //设置端口范围
"IpProtocol":"TCP", //设置协议类型
"Policy":"Accept" //设置访问策略
增加一条其他安全组和一条前缀列表的访问权限。
"RegionId":"cn-hangzhou",
"SecurityGroupId":"sg-bp67acfmxazb4p****",
"Permissions":[
"SourceGroupId":"sg-bp17vs63txqxbd****", //设置源端安全组
"PortRange":"22/22",
"IpProtocol":"TCP",
"Policy":"Drop"
"SourcePrefixListId":"pl-x1j1k5ykzqlixdcy****", //设置源端前缀列表
"PortRange":"22/22",
"IpProtocol":"TCP",
"Policy":"Drop"
如果指定了SourceGroupId,没有指定参数SourceCidrIp或Ipv6SourceCidrIp,则参数NicType取值只能为intranet。
如果同时指定了SourceGroupId和SourceCidrIp,则默认以SourceCidrIp为准。
需要设置访问权限的源端前缀列表 ID。您可以调用 DescribePrefixLists 查询可以使用的前缀列表 ID。
注意事项:
当您指定了SourceCidrIp、Ipv6SourceCidrIp或SourceGroupId参数中的一个时,将忽略该参数。
更多信息,请参见安全组使用限制。
pl-x1j1k5ykzqlixdcy****
专有网络 VPC 类型安全组规则无需设置网卡类型,默认为 intranet,只能为 intranet。
设置安全组之间互相访问时,即仅指定了 DestGroupId 参数时,只能为 intranet。
默认值:internet。
intranet
The specified security group network type is not support this operation, please check the security group network types. For VPC security groups, ClassicLink must be enabled.
指定的安全组网络类型不支持此操作,请检查安全组网络类型。对于 VPC 安全组,必须启用 ClassicLink。
One of the parameters SourceCidrIp, Ipv6SourceCidrIp, SourceGroupId or SourcePrefixListId in %s must be specified.
至少需要指定参数SourceCidrIp、SourceGroupId或SourcePrefixListId中的一个。
The specified parameter %s is not valid. It should be two integers less than 65535 in ?/? format.
端口范围不合法,应为斜线分隔两个整数的格式。
You have reached the limit on the number of group authorization rules that you can add to a security group.When authorization object of rule is security group, the limit is 20.
普通安全组内以安全组为授权对象的规则,最多只能20条。
The attributes Policy, SourceGroupId, DestGroupId of enterprise level security groups are not allowed to be set or modified.
企业级安全组不能指定Policy,SourceGroupId,DestGroupId等参数。
The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic).
指定的 SecurityGroup 的网络类型必须与 SouceGroup 的网络类型一致。
The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic).
指定的 SecurityGroup 的网络类型必须与 SouceGroup 的网络类型一致。