将 RejectVpcPeeringConnection 与 CLI 配合使用 - AWS SDK 代码示例

AWS 文档 SDK 示例 GitHub 存储库中还有更多 AWS SDK 示例。

RejectVpcPeeringConnection 与 CLI 配合使用

以下代码示例演示如何使用 RejectVpcPeeringConnection

CLI
AWS CLI

拒绝 VPC 对等连接

此示例拒绝指定的 VPC 对等连接请求。

命令:

aws ec2 reject-vpc-peering-connection --vpc-peering-connection-id pcx-1a2b3c4d

输出:

{ "Return": true }
PowerShell
Tools for PowerShell V4

示例 1:上面的示例拒绝 VpcPeering 请求 ID 为 pcx-01a2b3ce45fe67eb8 的请求

Deny-EC2VpcPeeringConnection -VpcPeeringConnectionId pcx-01a2b3ce45fe67eb8
Tools for PowerShell V5

示例 1:上面的示例拒绝 VpcPeering 请求 ID 为 pcx-01a2b3ce45fe67eb8 的请求

Deny-EC2VpcPeeringConnection -VpcPeeringConnectionId pcx-01a2b3ce45fe67eb8