@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
258 lines (257 loc) • 10.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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.ec2.VpcPeeringConnection` resource to manage its side of the connection
* and the accepter can use the `aws.ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the
* connection into management.
*
* ## Example Usage
*
* ### Cross-Account Peering Or Cross-Region Peering AWS Provider v6 (and below)
*
* ```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"});
* const peerVpc = new aws.ec2.Vpc("peer", {cidrBlock: "10.1.0.0/16"});
* 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),
* peerRegion: "us-west-2",
* 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",
* },
* });
* ```
*
* ### Cross-Region Peering (Same Account) AWS Provider v7 (and above)
*
* ```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"});
* const peer = new aws.ec2.Vpc("peer", {
* region: "us-west-2",
* cidrBlock: "10.1.0.0/16",
* });
* // Requester's side of the connection.
* const peerVpcPeeringConnection = new aws.ec2.VpcPeeringConnection("peer", {
* vpcId: main.id,
* peerVpcId: peer.id,
* peerRegion: "us-west-2",
* autoAccept: false,
* tags: {
* Side: "Requester",
* },
* });
* // Accepter's side of the connection.
* const peerVpcPeeringConnectionAccepter = new aws.ec2.VpcPeeringConnectionAccepter("peer", {
* region: "us-west-2",
* vpcPeeringConnectionId: peerVpcPeeringConnection.id,
* autoAccept: true,
* tags: {
* Side: "Accepter",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import VPC Peering Connection Accepters using the Peering Connection ID. For example:
*
* ```sh
* $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678
* ```
* Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use `ignore_changes` to hide the difference. For example:
*/
export declare class VpcPeeringConnectionAccepter extends pulumi.CustomResource {
/**
* Get an existing VpcPeeringConnectionAccepter 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?: VpcPeeringConnectionAccepterState, opts?: pulumi.CustomResourceOptions): VpcPeeringConnectionAccepter;
/**
* Returns true if the given object is an instance of VpcPeeringConnectionAccepter. 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 VpcPeeringConnectionAccepter;
/**
* The status of the VPC Peering Connection request.
*/
readonly acceptStatus: pulumi.Output<string>;
/**
* A configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
*/
readonly accepter: pulumi.Output<outputs.ec2.VpcPeeringConnectionAccepterAccepter>;
/**
* Whether or not to accept the peering request. Defaults to `false`.
*/
readonly autoAccept: pulumi.Output<boolean | undefined>;
/**
* The AWS account ID of the owner of the requester VPC.
*/
readonly peerOwnerId: pulumi.Output<string>;
/**
* The region of the accepter VPC.
*/
readonly peerRegion: pulumi.Output<string>;
/**
* The ID of the requester VPC.
*/
readonly peerVpcId: pulumi.Output<string>;
/**
* 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 configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
*/
readonly requester: pulumi.Output<outputs.ec2.VpcPeeringConnectionAccepterRequester>;
/**
* A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
readonly tagsAll: pulumi.Output<{
[key: string]: string;
}>;
/**
* The ID of the accepter VPC.
*/
readonly vpcId: pulumi.Output<string>;
/**
* The VPC Peering Connection ID to manage.
*/
readonly vpcPeeringConnectionId: pulumi.Output<string>;
/**
* Create a VpcPeeringConnectionAccepter 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: VpcPeeringConnectionAccepterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources.
*/
export interface VpcPeeringConnectionAccepterState {
/**
* The status of the VPC Peering Connection request.
*/
acceptStatus?: pulumi.Input<string>;
/**
* A configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
*/
accepter?: pulumi.Input<inputs.ec2.VpcPeeringConnectionAccepterAccepter>;
/**
* Whether or not to accept the peering request. Defaults to `false`.
*/
autoAccept?: pulumi.Input<boolean>;
/**
* The AWS account ID of the owner of the requester VPC.
*/
peerOwnerId?: pulumi.Input<string>;
/**
* The region of the accepter VPC.
*/
peerRegion?: pulumi.Input<string>;
/**
* The ID of the requester VPC.
*/
peerVpcId?: pulumi.Input<string>;
/**
* 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 configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
*/
requester?: pulumi.Input<inputs.ec2.VpcPeeringConnectionAccepterRequester>;
/**
* A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
tagsAll?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The ID of the accepter VPC.
*/
vpcId?: pulumi.Input<string>;
/**
* The VPC Peering Connection ID to manage.
*/
vpcPeeringConnectionId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a VpcPeeringConnectionAccepter resource.
*/
export interface VpcPeeringConnectionAccepterArgs {
/**
* A configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
*/
accepter?: pulumi.Input<inputs.ec2.VpcPeeringConnectionAccepterAccepter>;
/**
* Whether or not to accept the peering request. Defaults to `false`.
*/
autoAccept?: pulumi.Input<boolean>;
/**
* 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 configuration block that describes [VPC Peering Connection]
* (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
*/
requester?: pulumi.Input<inputs.ec2.VpcPeeringConnectionAccepterRequester>;
/**
* A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The VPC Peering Connection ID to manage.
*/
vpcPeeringConnectionId: pulumi.Input<string>;
}