github.com/nevins-b/terraform@v0.3.8-0.20170215184714-bbae22007d5a/website/source/docs/providers/aws/r/vpc_peering_accepter.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_vpc_peering_connection_accepter" 4 sidebar_current: "docs-aws-resource-vpc-peering-accepter" 5 description: |- 6 Manage the accepter's side of a cross-account VPC Peering Connection. 7 --- 8 9 # aws\_vpc\_peering\_connection\_accepter 10 11 Provides a resource to manage the accepter's side of a cross-account VPC Peering Connection. 12 13 When a cross-account (requester's AWS account differs from the accepter's AWS account) VPC Peering Connection 14 is created, a VPC Peering Connection resource is automatically created in the accepter's account. 15 The requester can use the `aws_vpc_peering_connection` resource to manage its side of the connection 16 and the accepter can use the `aws_vpc_peering_connection_accepter` resource to "adopt" its side of the 17 connection into management. 18 19 ## Example Usage 20 21 ``` 22 provider "aws" { 23 // Requester's credentials. 24 } 25 26 provider "aws" { 27 alias = "peer" 28 // Accepter's credentials. 29 } 30 31 resource "aws_vpc" "main" { 32 cidr_block = "10.0.0.0/16" 33 } 34 35 resource "aws_vpc" "peer" { 36 provider = "aws.peer" 37 cidr_block = "10.1.0.0/16" 38 } 39 40 data "aws_caller_identity" "peer" { 41 provider = "aws.peer" 42 } 43 44 // Requester's side of the connection. 45 resource "aws_vpc_peering_connection" "peer" { 46 vpc_id = "${aws_vpc.main.id}" 47 peer_vpc_id = "${aws_vpc.peer.id}" 48 peer_owner_id = "${data.aws_caller_identity.peer.account_id}" 49 auto_accept = false 50 51 tags { 52 Side = "Requester" 53 } 54 } 55 56 // Accepter's side of the connection. 57 resource "aws_vpc_peering_connection_accepter" "peer" { 58 provider = "aws.peer" 59 vpc_peering_connection_id = "${aws_vpc_peering_connection.peer.id}" 60 auto_accept = true 61 62 tags { 63 Side = "Accepter" 64 } 65 } 66 ``` 67 68 ## Argument Reference 69 70 The following arguments are supported: 71 72 * `vpc_peering_connection_id` - (Required) The VPC Peering Connection ID to manage. 73 * `auto_accept` - (Optional) Whether or not to accept the peering request. Defaults to `false`. 74 * `tags` - (Optional) A mapping of tags to assign to the resource. 75 76 ### Removing `aws_vpc_peering_connection_accepter` from your configuration 77 78 AWS allows a cross-account VPC Peering Connection to be deleted from either the requester's or accepter's side. 79 However, Terraform only allows the VPC Peering Connection to be deleted from the requester's side 80 by removing the corresponding `aws_vpc_peering_connection` resource from your configuration. 81 Removing a `aws_vpc_peering_connection_accepter` resource from your configuration will remove it 82 from your statefile and management, **but will not destroy the VPC Peering Connection.** 83 84 ## Attributes Reference 85 86 All of the argument attributes except `auto_accept` are also exported as result attributes. 87 88 * `id` - The ID of the VPC Peering Connection. 89 * `accept_status` - The status of the VPC Peering Connection request. 90 * `vpc_id` - The ID of the accepter VPC. 91 * `peer_vpc_id` - The ID of the requester VPC. 92 * `peer_owner_id` - The AWS account ID of the owner of the requester VPC. 93 * `accepter` - A configuration block that describes [VPC Peering Connection] 94 (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options set for the accepter VPC. 95 * `requester` - A configuration block that describes [VPC Peering Connection] 96 (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options set for the requester VPC. 97 98 #### Accepter and Requester Attributes Reference 99 100 * `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to 101 private IP addresses when queried from instances in a peer VPC. 102 * `allow_classic_link_to_remote_vpc` - Indicates whether a local ClassicLink connection can communicate 103 with the peer VPC over the VPC Peering Connection. 104 * `allow_vpc_to_remote_classic_link` - Indicates whether a local VPC can communicate with a ClassicLink 105 connection in the peer VPC over the VPC Peering Connection.