セキュリティグループからアウトバウンドルールを削除します。このアクションは、指定されたセキュリティグループ内のインスタンスからのアウトバウンドトラフィックのアクセスポリシーを他のデバイスに引き出します。
トラフィックの開始点を送信元、トラフィックの終点を宛先と定義します。詳細については、AuthorizeSecurityGroupEgress を参照してください。
セキュリティグループルールを削除するには、次の 2 つのパラメータセットを使用します。これらの 2 つのパラメータセットに基づいて 1 つのルールが存在しない場合、
RevokeSecurityGroupEgressは失敗します。
-
例えば、IP アドレス範囲のアクセスポリシーを撤回するには、 リクエスト例 1:
IpProtocol、PortRange、(オプション)SourcePortRange、NicType、Policy、DestCiderIp、(オプション)SourceCidrIp。 -
別のセキュリティグループに属しているインスタンスのアクセスポリシーを撤回するには、例えば、リクエスト例2:
IpProtocol、PortRange、(オプション)SourcePortRange、NicType、Policy、(オプション)DestCiderIp、DestGroupOwnerAccount、DestGroupIdです。
リクエストパラメータ
| Action | String | Yes | このインタフェースの名前。値:RevokeSecurityGroupEgress。 |
| RegionId | String | Yes | ソースセキュリティグループが属するリージョンの ID。
DescribeRegions
を呼び出して最新のリージョンリストを取得してください。
|
| SecurityGroupId | String | Yes | ソースセキュリティグループID。 |
| IpProtocol | String | Yes | トランスポート層プロトコル。オプションの値:
|
| PortRange | String | Yes | トランスポート層プロトコルに関連する宛先ポートの範囲。オプションの値:
|
| SourcePortRange | String | Yes | トランスポート層プロトコルに関連する送信元ポートの範囲。オプションの値:
|
| NicType | String | No | ネットワークタイプ。オプションの値:
DestCidrIpが指定されていない間、DestGroupIdが指定されていれば、 NicTypeをintranetとして指定する必要があります。 デフォルト値:internet。
|
| Policy | String | No | アクセス許可。オプションの値:
|
| DestCidrIp | String | No | 宛先 IP アドレスの範囲。CIDR と IPv4 形式のみがサポートされています。 デフォルト値: 0.0.0.0/0. |
| SourceCidrIp | String | No | 送信元 IP アドレスの範囲。CIDR と IPv4 形式のみがサポートされています。 デフォルト値: 0.0.0.0/0. |
| DestGroupId | String | No | 宛先セキュリティグループ ID。DestGroupIdまたはDestCidrIpパラメータのいずれかを設定する必要があります。両方が設定されている場合、 DestCidrIpはデフォルトで許可されます。DestGroupIdが指定され、DestCidrIpが指定されない場合、 NicTypeはintranetに設定されなければなりません。
|
| DestGroupOwnerAccount | String | No | 宛先セキュリティグループの Alibaba Cloud アカウント。DestGroupOwnerAccountおよびDestGroupOwnerIdが設定されていない場合、アクセスポリシーの取り消しは、同じアカウントのセキュリティグループに対して実行されます。DestCidrIpが既にセットされている場合、DestGroupOwnerAccountは無効です。
|
| DestGroupOwnerId | String | No | 宛先セキュリティグループの Alibaba Cloud アカウント ID。DestGroupOwnerAccountおよびDestGroupOwnerIdが設定されていない場合、アクセスポリシーの取り消しは、同じアカウントのセキュリティグループに対して実行されます。DestCidrIpが既に設定されている場合、DestGroupOwnerIdは無効です。
|
| Priority | String | No | アウトバウンドルールの優先度。値の範囲: [1, 100]。 デフォルト値: 1。 |
レスポンスパラメータ
すべての一般的なレスポンスパラメータの詳細については、コモンパラメータを参照してください。
例
リクエスト例 1
IP アドレス範囲のアクセスポリシーを取り消す。
https://ecs.aliyuncs.com/?Action=RevokeSecurityGroupEgress
&SecurityGroupId=sg-94n63e80l
&IpProtocol=all
&DestCidrIp=10.0.0.0/8
&PortRange=1/65535
&NicType=intranet
&Policy=Allow
&<Common Request Parameters>
リクエスト例 2
別のセキュリティグループのアクセスポリシーを撤回する
https://ecs.aliyuncs.com/?Action=RevokeSecurityGroupEgress
&SecurityGroupId=sg-F876FF7BA
&DestGroupId=sg-1651FBB64
&DestGroupOwnerAccount=test@aliyun.com
&IpProtocol=tcp
&PortRange=22/22
&NicType=intranet
&Policy=Drop
&<Common Request Parameters>
レスポンスの例
XML形式
<RevokeSecurityGroupEgressResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</RevokeSecurityGroupEgressResponse>
JSON形式
{
"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
エラーコード
インタフェースに固有のエラーコードは次のとおりです。詳細については、API エラー・センターを参照してください。
| InvalidDestCidrIp.Malformed | The specified parameter “DestCidrIp” is not valid. | 400 | 指定された DestCidrIpは無効です。
|
| InvalidDestCidrIp.sMalformed | The specified parameter “DestCidrIp” is not valid. | 400 | 指定された DestCidrIpは無効です。
|
| InvalidDestGroupId.Mismatch | Specified security group and destination group are not in the same VPC. | 400 | 指定された宛先セキュリティグループのネットワークタイプは VPC であるため、宛先セキュリティグループは VPC に接続する必要があります。 |
| InvalidIpPortRange.Malformed | The specified parameter “PortRange” is not valid. | 400 | 指定された PortRangeは無効です。
|
| InvalidIpProtocol.ValueNotSupported | The specified IpProtocol does not exist. | 400 | 指定された IpProtocolは終了しません。
|
| InvalidNicType.ValueNotSupported | The specified NicType does not exist. | 400 | 指定された NicTypeは終了しません。
|
| InvalidPolicy.Malformed | The specified parameter “Policy” is not valid. | 400 | 指定された Policyは無効です。
|
| MissingParameter | The input parameter “DestGroupId” or “DestCidrIp” cannot be both blank. | 400 |
DestGroupIdかDestCidrIpのどちらかを指定しなければなりません。
|
| InvalidGroupAuthItem.NotFound | Specified group authorized item does not exist in our records. | 403 | 指定された送信セキュリティグループルールは存在しません。 |
| InvalidNicType.Mismatch | Specified nic type conflicts with the authorization record. | 403 | 指定された NicTypeは無効です。
|
| InvalidSecurityGroup.IsSame | The authorized SecurityGroupId should be different from the DestGroupId. | 403 |
SecurityGroupIdとDestGroupIdは同じセキュリティグループを示すことはできません。
|
| InvalidDestGroupId.NotFound | The DestGroupId provided does not exist in our records. | 404 | 指定された DestGroupIdは終了しません。
|
| InvalidRegionId.NotFound | The specified RegionId does not exist. | 404 | 指定された RegionIdは終了しません。
|
| InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | 404 | 指定された SecurityGroupIdは終了しません。
|