<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import pulumi
import pulumi.runtime

class PeeringConnectionOptions(pulumi.CustomResource):
    """
    Provides a resource to manage VPC peering connection options.
    
    ~> **NOTE on VPC Peering Connections and VPC Peering Connection Options:** Terraform provides
    both a standalone VPC Peering Connection Options and a [VPC Peering Connection](vpc_peering.html)
    resource with `accepter` and `requester` attributes. Do not manage options for the same VPC peering
    connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource.
    Doing so will cause a conflict of options and will overwrite the options.
    Using a VPC Peering Connection Options resource decouples management of the connection options from
    management of the VPC Peering Connection and allows options to be set correctly in cross-account scenarios.
    
    Basic usage:
    
    ```hcl
    resource "aws_vpc" "foo" {
      cidr_block = "10.0.0.0/16"
    }
    
    resource "aws_vpc" "bar" {
      cidr_block = "10.1.0.0/16"
    }
    
    resource "aws_vpc_peering_connection" "foo" {
      vpc_id        = "${aws_vpc.foo.id}"
      peer_vpc_id   = "${aws_vpc.bar.id}"
      auto_accept   = true
    }
    
    resource "aws_vpc_peering_connection_options" "foo" {
      vpc_peering_connection_id = "${aws_vpc_peering_connection.foo.id}"
    
      accepter {
        allow_remote_vpc_dns_resolution = true
      }
    
      requester {
        allow_vpc_to_remote_classic_link = true
        allow_classic_link_to_remote_vpc = true
      }
    }
    ```
    
    Basic cross-account usage:
    
    ```hcl
    provider "aws" {
      alias = "requester"
    
      # Requester's credentials.
    }
    
    provider "aws" {
      alias = "accepter"
    
      # Accepter's credentials.
    }
    
    resource "aws_vpc" "main" {
      provider = "aws.requester"
    
      cidr_block = "10.0.0.0/16"
    
      enable_dns_support   = true
      enable_dns_hostnames = true
    }
    
    resource "aws_vpc" "peer" {
      provider = "aws.accepter"
    
      cidr_block = "10.1.0.0/16"
    
      enable_dns_support   = true
      enable_dns_hostnames = true
    }
    
    data "aws_caller_identity" "peer" {
      provider = "aws.accepter"
    }
    """
    def __init__(__self__, __name__, __opts__=None, accepter=None, requester=None, vpc_peering_connection_id=None):
        """Create a PeeringConnectionOptions resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if accepter and not isinstance(accepter, dict):
            raise TypeError('Expected property accepter to be a dict')
        __self__.accepter = accepter
        """
        An optional configuration block that allows for [VPC Peering Connection]
        (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options to be set for the VPC that accepts
        the peering connection (a maximum of one).
        """
        __props__['accepter'] = accepter

        if requester and not isinstance(requester, dict):
            raise TypeError('Expected property requester to be a dict')
        __self__.requester = requester
        """
        A optional configuration block that allows for [VPC Peering Connection]
        (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide) options to be set for the VPC that requests
        the peering connection (a maximum of one).
        """
        __props__['requester'] = requester

        if not vpc_peering_connection_id:
            raise TypeError('Missing required property vpc_peering_connection_id')
        elif not isinstance(vpc_peering_connection_id, basestring):
            raise TypeError('Expected property vpc_peering_connection_id to be a basestring')
        __self__.vpc_peering_connection_id = vpc_peering_connection_id
        """
        The ID of the requester VPC peering connection.
        """
        __props__['vpcPeeringConnectionId'] = vpc_peering_connection_id

        super(PeeringConnectionOptions, __self__).__init__(
            'aws:ec2/peeringConnectionOptions:PeeringConnectionOptions',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'accepter' in outs:
            self.accepter = outs['accepter']
        if 'requester' in outs:
            self.requester = outs['requester']
        if 'vpcPeeringConnectionId' in outs:
            self.vpc_peering_connection_id = outs['vpcPeeringConnectionId']
