将 RejectVpcPeeringConnection 与 CLI 配合使用 - Amazon Elastic Compute Cloud

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

有关 AWS SDK 开发人员指南和代码示例的完整列表,请参阅 使用 AWS SDK 创建 Amazon EC2 资源。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。