Rejecting a VPC Peering Connection

You can reject a VPC peering connection requested between one of your Virtual Private Clouds (VPCs) and another VPC.

This action updates the state of the connection from pending-acceptance to rejected. For more information, see About VPC Peering Connections > Lifecycle.

Rejecting a VPC Peering Connection Using Cockpit

  1. Click VPC > VPC Peering Connections.

  2. Select the VPC peering connection you want to reject.
    The VPC peering connection is selected.

  3. Click Reject .
    A confirmation dialog box appears.

  4. Click Reject to validate.
    The VPC peering connection is rejected.

    A rejected VPC peering connection remains visible for 1 hour.

Rejecting a VPC Peering Connection Using AWS CLI

To reject a VPC peering connection, use the reject-vpc-peering-connection command following this syntax:

Request sample
$ aws ec2 reject-pc-peering-connection \
    --profile YOUR_PROFILE \
    --vpc-peering-connection-id pcx-111aaa11 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • vpc-peering-connection-id: The ID of the VPC peering connection you want to reject.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The reject-vpc-peering-connection command returns a boolean result:

  • Return: If true, the specified VPC peering connection is rejected. Otherwise, an error has occurred.

A rejected VPC peering connection remains visible for 1 hour.

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.