Accepting a VPC Peering Connection
You can accept a VPC peering connection requested between one of your Virtual Private Clouds (VPCs) and another VPC to enable communication between them.
This action updates the state of the connection from pending-acceptance
to active
. Only the owner of the accepter VPC can accept a connection request. You cannot yourself accept a request you sent to another account. For more information, see About VPC Peering Connections.
-
If you use Cockpit v1 to create a VPC peering connection between two VPCs that belong to your account, the request is automatically accepted.
-
A peering connection between two VPCs works both ways. Therefore, you do not need to create a B-to-A connection if an A-to-B connection is already created and accepted.
For safety reasons, never accept a VPC peering connection with an unknown account. |
Accepting a VPC Peering Connection Using Cockpit v1
-
Click VPC > VPC Peering Connections.
-
Select the VPC peering connection you want to accept.
The VPC peering connection is selected. -
Click Accept .
A confirmation dialog box appears. -
Click Accept to validate.
The VPC peering connection is accepted.
Accepting a Net Peering Using OSC CLI
See the AcceptNetPeering command sample in the documentation of the OUTSCALE API. |
Accepting a VPC Peering Connection Using AWS CLI
To accept a VPC peering connection, use the accept-vpc-peering-connection command following this syntax:
$ aws ec2 accept-vpc-peering-connection \
--profile YOUR_PROFILE \
--vpc-peering-connection-id pcx-111aaa111 \
--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 accept. -
endpoint
: The endpoint corresponding to the Region you want to send the request to.
The accept-vpc-peering-connection command returns the following elements:
-
VpcPeeringConnection
: Information about the VPC peering connection. This element contains the following information:-
AccepterVpcInfo
: Information about the accepter VPC. This element contains the following information:-
CidrBlock
: The range of IPs of the VPC, in CIDR notation. -
OwnerId
: The account ID of the owner of the VPC. -
VpcId
: The ID of the VPC.
-
-
ExpirationTime
: The date after which the VPC peering connection request in thepending-acceptance
state would have expired. -
RequesterVpcInfo
: Information about the requester VPC. This element contains the following information:-
CidrBlock
: The range of IPs of the VPC, in CIDR notation. -
OwnerId
: The account ID of the owner of the VPC. -
VpcId
: The ID of the VPC.
-
-
Status
: Information about the state of the VPC peering connection. This element contains the following information:-
Code
: The state of the VPC peering connection (active
). -
Message
: Additional information about the state of the VPC peering connection.
-
-
Tags
: One or more tags associated with the VPC peering connection. This element contains the following information:-
Key
: The key of the tag. -
Value
: The value of the tag.
-
-
VpcPeeringConnectionId
: The ID of the VPC peering connection.
-
{
"VpcPeeringConnection": {
"AccepterVpcInfo": {
"CidrBlock": "172.16.0.0/28",
"OwnerId": "888877776666",
"VpcId": "vpc-11122233"
},
"ExpirationTime": "2018-03-26T13:01:33.176Z",
"RequesterVpcInfo": {
"CidrBlock": "10.0.0.0/28",
"OwnerId": "444455556666",
"VpcId": "vpc-1a2b3c4d"
},
"Status": {
"Code": "active",
"Message": "Active"
},
"Tags": [],
"VpcPeeringConnectionId": "pcx-111aaa11"
}
}
The specified VPC peering connection is accepted.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.