AWS Amazon EC2 Peering Connection Accepter

This page shows how to write Terraform and CloudFormation for Amazon EC2 Peering Connection Accepter and write them securely.

aws_vpc_peering_connection_accepter (Terraform)

The Peering Connection Accepter in Amazon EC2 can be configured in Terraform with the resource name aws_vpc_peering_connection_accepter. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

github-iconhuanwlisa/terraform
resource "aws_vpc_peering_connection_accepter" "us-east-2-us-east-1" {
provider = aws.us-east-2
vpc_peering_connection_id = aws_vpc_peering_connection.us-east-1-us-east-2.id
auto_accept = true
}
resource "aws_vpc_peering_connection" "us-east-1-us-west-1" {
github-iconbstascavage/terraform-vault-consul-deployment
resource "aws_vpc_peering_connection_accepter" "bastion_connectivity_dr" {
  provider                  = aws.us-east-1
  vpc_peering_connection_id = aws_vpc_peering_connection.bastion_connectivity_dr.id
  auto_accept               = true

}
github-iconbrucehvn/edify
resource "aws_vpc_peering_connection_accepter" "east2_east1_accepter" {
  provider                  = aws
  vpc_peering_connection_id = aws_vpc_peering_connection.east2_to_east1.id
  auto_accept               = true

  tags = {
github-iconValAug/VPC-Peering
resource "aws_vpc_peering_connection_accepter" "accepter_connection_one" {
  vpc_peering_connection_id = aws_vpc_peering_connection.peering_connection_one.id
  auto_accept               = true

  tags = {
    Side = "VPC Peering A Accepter"
github-iconrahil033/terraform_project
resource "aws_vpc_peering_connection_accepter" "this" {
  vpc_peering_connection_id = var.id
  auto_accept               = true
  tags = {
      Name = var.name
  }

Parameters

Explanation in Terraform Registry

Provides a resource to manage the accepter's side of a VPC Peering Connection. When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter's account. The requester can use the aws_vpc_peering_connection resource to manage its side of the connection and the accepter can use the aws_vpc_peering_connection_accepter resource to "adopt" its side of the connection into management.

AWS::EC2::VPCPeeringConnection (CloudFormation)

The VPCPeeringConnection in EC2 can be configured in CloudFormation with the resource name AWS::EC2::VPCPeeringConnection. The following sections describe how to use the resource and its parameters.

Parameters

Explanation in CloudFormation Registry

Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC.

The requester VPC and accepter VPC cannot have overlapping CIDR blocks. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.

For more information, see Walkthough: Peer with a VPC in another AWS account.

Frequently asked questions

What is AWS Amazon EC2 Peering Connection Accepter?

AWS Amazon EC2 Peering Connection Accepter is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 Peering Connection Accepter?

For Terraform, the huanwlisa/terraform, bstascavage/terraform-vault-consul-deployment and brucehvn/edify source code examples are useful. See the Terraform Example section for further details.