github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    22  provider "aws" {
    23    // Requester's credentials.
    24  }
    25  
    26  provider "aws" {
    27    alias = "peer"
    28  
    29    // Accepter's credentials.
    30  }
    31  
    32  resource "aws_vpc" "main" {
    33    cidr_block = "10.0.0.0/16"
    34  }
    35  
    36  resource "aws_vpc" "peer" {
    37    provider   = "aws.peer"
    38    cidr_block = "10.1.0.0/16"
    39  }
    40  
    41  data "aws_caller_identity" "peer" {
    42    provider = "aws.peer"
    43  }
    44  
    45  // Requester's side of the connection.
    46  resource "aws_vpc_peering_connection" "peer" {
    47    vpc_id        = "${aws_vpc.main.id}"
    48    peer_vpc_id   = "${aws_vpc.peer.id}"
    49    peer_owner_id = "${data.aws_caller_identity.peer.account_id}"
    50    auto_accept   = false
    51  
    52    tags {
    53      Side = "Requester"
    54    }
    55  }
    56  
    57  // Accepter's side of the connection.
    58  resource "aws_vpc_peering_connection_accepter" "peer" {
    59    provider                  = "aws.peer"
    60    vpc_peering_connection_id = "${aws_vpc_peering_connection.peer.id}"
    61    auto_accept               = true
    62  
    63    tags {
    64      Side = "Accepter"
    65    }
    66  }
    67  ```
    68  
    69  ## Argument Reference
    70  
    71  The following arguments are supported:
    72  
    73  * `vpc_peering_connection_id` - (Required) The VPC Peering Connection ID to manage.
    74  * `auto_accept` - (Optional) Whether or not to accept the peering request. Defaults to `false`.
    75  * `tags` - (Optional) A mapping of tags to assign to the resource.
    76  
    77  ### Removing `aws_vpc_peering_connection_accepter` from your configuration
    78  
    79  AWS allows a cross-account VPC Peering Connection to be deleted from either the requester's or accepter's side.
    80  However, Terraform only allows the VPC Peering Connection to be deleted from the requester's side
    81  by removing the corresponding `aws_vpc_peering_connection` resource from your configuration.
    82  Removing a `aws_vpc_peering_connection_accepter` resource from your configuration will remove it
    83  from your statefile and management, **but will not destroy the VPC Peering Connection.**
    84  
    85  ## Attributes Reference
    86  
    87  All of the argument attributes except `auto_accept` are also exported as result attributes.
    88  
    89  * `id` - The ID of the VPC Peering Connection.
    90  * `accept_status` - The status of the VPC Peering Connection request.
    91  * `vpc_id` - The ID of the accepter VPC.
    92  * `peer_vpc_id` - The ID of the requester VPC.
    93  * `peer_owner_id` - The AWS account ID of the owner of the requester VPC.
    94  * `accepter` - A configuration block that describes [VPC Peering Connection]
    95  (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options set for the accepter VPC.
    96  * `requester` - A configuration block that describes [VPC Peering Connection]
    97  (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options set for the requester VPC.
    98  
    99  #### Accepter and Requester Attributes Reference
   100  
   101  * `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to
   102  private IP addresses when queried from instances in a peer VPC.
   103  * `allow_classic_link_to_remote_vpc` - Indicates whether a local ClassicLink connection can communicate
   104  with the peer VPC over the VPC Peering Connection.
   105  * `allow_vpc_to_remote_classic_link` - Indicates whether a local VPC can communicate with a ClassicLink
   106  connection in the peer VPC over the VPC Peering Connection.