指定されたセキュリティグループのインバウンドセキュリティグループルールを変更します。
操作説明
セキュリティグループルール ID を指定してセキュリティグループルールを変更する場合、以下の使用制限に注意してください:
-
セキュリティグループルールの権限付与オブジェクトには、IPv4 CIDR ブロック(または IP アドレス)、IPv6 CIDR ブロック(または IP アドレス)、セキュリティグループ、またはプレフィックスリストを指定できます。この操作を使用して、既存のセキュリティグループルールの権限付与オブジェクトのタイプを変更することはできません。たとえば、元の権限付与オブジェクトタイプが IPv4 CIDR ブロックの場合、別の IPv4 CIDR ブロック(または IP アドレス)に変更できますが、IPv6 CIDR ブロック(または IP アドレス)、セキュリティグループ、またはプレフィックスリストには変更できません。
-
フィールド値を空でない値から空の値に変更することはできません。この場合にセキュリティグループルールを変更するには、新しいルールを追加してから現在のルールを削除してください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:ModifySecurityGroupRule |
update |
*All Resource
|
|
なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
セキュリティグループのリージョン ID。 DescribeRegions を呼び出して、最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| RegionId |
string |
必須 |
セキュリティグループのリージョン ID。 DescribeRegions を呼び出して、最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用されるクライアントトークン。クライアントを使用してトークンを生成できますが、異なるリクエスト間でトークンが一意であることを確認してください。ClientToken パラメーターは ASCII 文字のみをサポートし、64 文字を超えることはできません。詳細については、べき等性の確保方法 を参照してください。 |
123e4567-e89b-12d3-a456-426655440000 |
| SecurityGroupId |
string |
必須 |
セキュリティグループ ID。 |
sg-bp67acfmxazb4p**** |
| SecurityGroupRuleId |
string |
任意 |
セキュリティグループルール ID。 DescribeSecurityGroupAttribute を呼び出して、セキュリティグループルール ID をクエリできます。 |
sgr-bp67acfmxa123b*** |
| Policy |
string |
任意 |
アクセス権限。有効な値:
デフォルト値: accept。 |
accept |
| Priority |
string |
任意 |
セキュリティグループルールの優先度。有効な値: 1~100。 デフォルト値: 1。 |
1 |
| IpProtocol |
string |
任意 |
ネットワーク層またはトランスポートレイヤーのプロトコル。2 種類の値がサポートされています:
|
ALL |
| SourceCidrIp |
string |
任意 |
アクセス権限のソース IPv4 CIDR ブロックの設定項目。CIDR 初期化および IPv4 初期化の IP アドレス範囲がサポートされています。 デフォルト値: null。 |
10.0.0.0/8 |
| Ipv6SourceCidrIp |
string |
任意 |
アクセス権限のソース IPv6 CIDR ブロックの設定項目。CIDR 初期化および IPv6 初期化の IP アドレス範囲がサポートされています。 説明
VPC タイプの IP アドレスのみがサポートされています。このパラメーターと デフォルト値: null。 |
2001:db8:1233:1a00::*** |
| SourceGroupId |
string |
任意 |
アクセス権限のソースセキュリティグループ ID の設定項目。
|
sg-bp67acfmxa123b**** |
| SourcePrefixListId |
string |
任意 |
アクセス権限のソースプレフィックスリスト ID の設定項目。 DescribePrefixLists を呼び出して、使用可能なプレフィックスリスト ID をクエリできます。
|
pl-x1j1k5ykzqlixdcy**** |
| PortRange |
string |
任意 |
セキュリティグループのトランスポートレイヤープロトコルに対応する送信先ポートの有効値。有効な値:
|
80/80 |
| DestCidrIp |
string |
任意 |
送信先 IPv4 CIDR ブロック。CIDR 初期化および IPv4 初期化の IP アドレス範囲がサポートされています。 デフォルト値: null。 |
10.0.0.0/8 |
| Ipv6DestCidrIp |
string |
任意 |
送信先 IPv6 CIDR ブロックの設定項目。CIDR 初期化および IPv6 初期化の IP アドレス範囲がサポートされています。 説明
VPC タイプの IP アドレスのみがサポートされています。このパラメーターと デフォルト値: null。 |
2001:db8:1234:1a00::*** |
| SourcePortRange |
string |
任意 |
セキュリティグループのトランスポートレイヤープロトコルに対応するソースポートの有効値。有効な値:
|
80/80 |
| SourceGroupOwnerAccount |
string |
任意 |
クロスアカウントセキュリティグループルールのアクセス権限を設定する際の、ソースセキュリティグループを所有する Alibaba Cloud アカウントの設定項目。
|
EcsforCloud@Alibaba.com |
| SourceGroupOwnerId |
integer |
任意 |
クロスアカウントセキュリティグループルールのアクセス権限を設定する際の、ソースセキュリティグループを所有する Alibaba Cloud アカウント ID の設定項目。
|
12345678910 |
| NicType |
string |
任意 |
ネットワークインターフェースコントローラー(NIC)タイプ。 説明
セキュリティグループルール ID を指定してルールを変更する場合、このパラメーターは変更できません。このような変更を行うには、新しいルールを追加してから現在のルールを削除してください。 |
intranet |
| Description |
string |
任意 |
セキュリティグループルールの説明。説明は 1~512 文字である必要があります。 |
This is a new security group rule. |
| PortRangeListId |
string |
任意 |
ポートアドレス帳 ID。
PortRange パラメーターを指定した場合、このパラメーターは無視されます。 詳細については、セキュリティグループの使用制限 を参照してください。 |
prl-2ze9743**** |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエスト ID |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | OperationDenied | The specified IpProtocol does not exist or IpProtocol and PortRange do not match. | |
| 400 | InvalidIpProtocol.Malformed | The specified parameter PortRange is not valid. | |
| 400 | InvalidSourceCidrIp.Malformed | The specified parameter SourceCidrIp is not valid. | |
| 400 | InvalidPolicy.Malformed | The specified parameter Policy is not valid. | |
| 400 | InvalidNicType.ValueNotSupported | The specified NicType does not exist. | |
| 400 | InvalidNicType.Mismatch | The specified NicType conflicts with the authorization record. | |
| 400 | InvalidSourceGroupId.Mismatch | Specified security group and source group are not in the same VPC. | |
| 400 | InvalidSourceGroup.NotFound | Specified source security group does not exist. | |
| 400 | InvalidPriority.Malformed | The parameter Priority is invalid. | |
| 400 | InvalidPriority.ValueNotSupported | The parameter Priority is invalid. | |
| 400 | InvalidSecurityGroupDiscription.Malformed | The specified security group rule description is not valid. | |
| 400 | MissingParameter.Source | One of the parameters SourceCidrIp, SourceGroupId or SourcePrefixListId must be specified. | |
| 400 | InvalidParam.PortRange | The specified parameter %s is not valid. It should be two integers less than 65535 in ?/? format. | |
| 400 | InvalidIpProtocol.ValueNotSupported | The parameter IpProtocol must be specified with case insensitive TCP, UDP, ICMP, GRE or All. | |
| 400 | InvalidParam.SourceIp | The Parameters SourceCidrIp and Ipv6SourceCidrIp in %s cannot be set at the same time. | |
| 400 | InvalidParam.DestIp | The Parameters DestCidrIp and Ipv6DestCidrIp in %s cannot be set at the same time. | |
| 400 | InvalidParam.Ipv6DestCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.Ipv6SourceCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.Ipv4ProtocolConflictWithIpv6Address | IPv6 address cannot be specified for IPv4-specific protocol. | |
| 400 | InvalidParam.Ipv6ProtocolConflictWithIpv4Address | IPv4 address cannot be specified for IPv6-specific protocol. | |
| 400 | InvalidParameter.Ipv6CidrIp | The specified Ipv6CidrIp is not valid. | |
| 400 | InvalidParam.DestCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidSourcePortRange.Malformed | The specified parameter SourcePortRange is not valid. | |
| 400 | InvalidSecurityGroupId.Malformed | The specified parameter SecurityGroupId is not valid. | |
| 400 | InvalidParam.SourceCidrIp | The specified param SourceCidrIp is not valid. | |
| 400 | InvalidParameter.Conflict | IPv6 and IPv4 addresses cannot exist at the same time. | |
| 400 | InvalidParam.SecurityGroupRuleId | The specified parameter SecurityGroupRuleId is not valid. | |
| 400 | InvalidOperation.ModifySgRuleEntityType | The source or destination type of the rules cannot be modified. | |
| 400 | AuthorizationLimitExceed | The limit of authorization records in the security group reaches. | |
| 400 | InvalidParam.ProtocolAndPortRangeMismatch | The specified Protocol and PortRange do not match. | |
| 400 | InvalidParam.ProtocolAndAddressFamilyMismatch | The specified Protocol and address family do not match. | |
| 400 | InvalidParam.PrefixListAddressFamilyMismatch | The address family of the prefix list does not match the rule. | |
| 400 | InvalidParam.InvalidModifyRuleRequest | The request parameters are illegal. | |
| 400 | InvalidOperation.ModifyNicType | NicType is not allowed to modify. | |
| 400 | InvalidParamter.Conflict | The specified SourceCidrIp should be different from the DestCidrIp. | |
| 400 | InvalidOperation.RuleDuplicate | %s. | |
| 400 | InvalidParam.ProtocolNotSupportPortRangeList | The specified protocol does not support the port range list. | |
| 400 | InvalidSourceOrDestGroupId.DirectionMissmatch | The specified SourceGroupId or DestGroupId does not match the direction of the rule. | |
| 400 | InvalidOperation.ModifyPortRangeType | The PortRange type is not allowed to be modified. You cannot modify a rule from using the port list to not using it, and vice versa. | |
| 400 | InvalidPortRangeListId.NotFound | The specified port range list was not found. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | InvalidSourceGroupId.Mismatch | NicType is required or NicType expects intrnet. | |
| 403 | MissingParameter | The input parameter SourceGroupId or SourceCidrIp cannot be both blank. | |
| 403 | AuthorizationLimitExceed | The limit of authorization records in the security group reaches. | |
| 403 | InvalidParamter.Conflict | The specified SecurityGroupId should be different from the SourceGroupId. | |
| 403 | InvalidNetworkType.Mismatch | The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic). | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | |
| 404 | InvalidSourceGroupId.NotFound | The SourceGroupId provided does not exist in our records. | |
| 404 | SecurityGroupRule.NotFound | The target security group rule not exist. | |
| 404 | InvalidPrefixListId.NotFound | The specified prefix list was not found. | |
| 404 | InvalidSecurityGroupRuleId.NotFound | The specified SecurityGroupRuleId is not exists. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。