UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

179 lines (178 loc) 8.15 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides a resource to manage VPC peering connection options. * * > **NOTE on VPC Peering Connections and VPC Peering Connection Options:** This provider provides * both a standalone VPC Peering Connection Options and a VPC Peering Connection * 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-region and * cross-account scenarios. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const foo = new aws.ec2.Vpc("foo", {cidrBlock: "10.0.0.0/16"}); * const bar = new aws.ec2.Vpc("bar", {cidrBlock: "10.1.0.0/16"}); * const fooVpcPeeringConnection = new aws.ec2.VpcPeeringConnection("foo", { * vpcId: foo.id, * peerVpcId: bar.id, * autoAccept: true, * }); * const fooPeeringConnectionOptions = new aws.ec2.PeeringConnectionOptions("foo", { * vpcPeeringConnectionId: fooVpcPeeringConnection.id, * accepter: { * allowRemoteVpcDnsResolution: true, * }, * }); * ``` * * ### Cross-Account Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.ec2.Vpc("main", { * cidrBlock: "10.0.0.0/16", * enableDnsSupport: true, * enableDnsHostnames: true, * }); * const peerVpc = new aws.ec2.Vpc("peer", { * cidrBlock: "10.1.0.0/16", * enableDnsSupport: true, * enableDnsHostnames: true, * }); * const peer = aws.getCallerIdentity({}); * // Requester's side of the connection. * const peerVpcPeeringConnection = new aws.ec2.VpcPeeringConnection("peer", { * vpcId: main.id, * peerVpcId: peerVpc.id, * peerOwnerId: peer.then(peer => peer.accountId), * autoAccept: false, * tags: { * Side: "Requester", * }, * }); * // Accepter's side of the connection. * const peerVpcPeeringConnectionAccepter = new aws.ec2.VpcPeeringConnectionAccepter("peer", { * vpcPeeringConnectionId: peerVpcPeeringConnection.id, * autoAccept: true, * tags: { * Side: "Accepter", * }, * }); * const requester = new aws.ec2.PeeringConnectionOptions("requester", { * vpcPeeringConnectionId: peerVpcPeeringConnectionAccepter.id, * requester: { * allowRemoteVpcDnsResolution: true, * }, * }); * const accepter = new aws.ec2.PeeringConnectionOptions("accepter", { * vpcPeeringConnectionId: peerVpcPeeringConnectionAccepter.id, * accepter: { * allowRemoteVpcDnsResolution: true, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import VPC Peering Connection Options using the VPC peering `id`. For example: * * ```sh * $ pulumi import aws:ec2/peeringConnectionOptions:PeeringConnectionOptions foo pcx-111aaa111 * ``` */ export declare class PeeringConnectionOptions extends pulumi.CustomResource { /** * Get an existing PeeringConnectionOptions resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PeeringConnectionOptionsState, opts?: pulumi.CustomResourceOptions): PeeringConnectionOptions; /** * Returns true if the given object is an instance of PeeringConnectionOptions. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PeeringConnectionOptions; /** * An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts the peering connection (a maximum of one). */ readonly accepter: pulumi.Output<outputs.ec2.PeeringConnectionOptionsAccepter>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests the peering connection (a maximum of one). */ readonly requester: pulumi.Output<outputs.ec2.PeeringConnectionOptionsRequester>; /** * The ID of the requester VPC peering connection. */ readonly vpcPeeringConnectionId: pulumi.Output<string>; /** * Create a PeeringConnectionOptions resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: PeeringConnectionOptionsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PeeringConnectionOptions resources. */ export interface PeeringConnectionOptionsState { /** * An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts the peering connection (a maximum of one). */ accepter?: pulumi.Input<inputs.ec2.PeeringConnectionOptionsAccepter>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests the peering connection (a maximum of one). */ requester?: pulumi.Input<inputs.ec2.PeeringConnectionOptionsRequester>; /** * The ID of the requester VPC peering connection. */ vpcPeeringConnectionId?: pulumi.Input<string>; } /** * The set of arguments for constructing a PeeringConnectionOptions resource. */ export interface PeeringConnectionOptionsArgs { /** * An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts the peering connection (a maximum of one). */ accepter?: pulumi.Input<inputs.ec2.PeeringConnectionOptionsAccepter>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests the peering connection (a maximum of one). */ requester?: pulumi.Input<inputs.ec2.PeeringConnectionOptionsRequester>; /** * The ID of the requester VPC peering connection. */ vpcPeeringConnectionId: pulumi.Input<string>; }