@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
215 lines (214 loc) • 9.41 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a network peering within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/vpc/vpc-peering)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/networks).
*
* > Both networks must create a peering with each other for the peering
* to be functional.
*
* > Subnets IP ranges across peered VPC networks cannot overlap.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.Network("default", {
* name: "foobar",
* autoCreateSubnetworks: false,
* });
* const other = new gcp.compute.Network("other", {
* name: "other",
* autoCreateSubnetworks: false,
* });
* const peering1 = new gcp.compute.NetworkPeering("peering1", {
* name: "peering1",
* network: _default.selfLink,
* peerNetwork: other.selfLink,
* });
* const peering2 = new gcp.compute.NetworkPeering("peering2", {
* name: "peering2",
* network: other.selfLink,
* peerNetwork: _default.selfLink,
* });
* ```
*
* ## Import
*
* VPC network peerings can be imported using the name and project of the primary network the peering exists in and the name of the network peering
*
* * `{{project_id}}/{{network_id}}/{{peering_id}}`
*
* When using the `pulumi import` command, VPC network peerings can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/networkPeering:NetworkPeering default {{project_id}}/{{network_id}}/{{peering_id}}
* ```
*/
export declare class NetworkPeering extends pulumi.CustomResource {
/**
* Get an existing NetworkPeering 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?: NetworkPeeringState, opts?: pulumi.CustomResourceOptions): NetworkPeering;
/**
* Returns true if the given object is an instance of NetworkPeering. 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 NetworkPeering;
/**
* Whether to export the custom routes to the peer network. Defaults to `false`.
*/
readonly exportCustomRoutes: pulumi.Output<boolean | undefined>;
/**
* Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field.
*/
readonly exportSubnetRoutesWithPublicIp: pulumi.Output<boolean | undefined>;
/**
* Whether to import the custom routes from the peer network. Defaults to `false`.
*/
readonly importCustomRoutes: pulumi.Output<boolean | undefined>;
/**
* Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field.
*/
readonly importSubnetRoutesWithPublicIp: pulumi.Output<boolean | undefined>;
/**
* Name of the peering.
*/
readonly name: pulumi.Output<string>;
/**
* The primary network of the peering.
*/
readonly network: pulumi.Output<string>;
/**
* The peer network in the peering. The peer network
* may belong to a different project.
*/
readonly peerNetwork: pulumi.Output<string>;
/**
* Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"].
*/
readonly stackType: pulumi.Output<string | undefined>;
/**
* State for the peering, either `ACTIVE` or `INACTIVE`. The peering is
* `ACTIVE` when there's a matching configuration in the peer network.
*/
readonly state: pulumi.Output<string>;
/**
* Details about the current state of the peering.
*/
readonly stateDetails: pulumi.Output<string>;
/**
* The update strategy determines the semantics for updates and deletes to the peering connection configuration. The default value is INDEPENDENT. Possible values: ["INDEPENDENT", "CONSENSUS"]
*/
readonly updateStrategy: pulumi.Output<string | undefined>;
/**
* Create a NetworkPeering 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: NetworkPeeringArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NetworkPeering resources.
*/
export interface NetworkPeeringState {
/**
* Whether to export the custom routes to the peer network. Defaults to `false`.
*/
exportCustomRoutes?: pulumi.Input<boolean>;
/**
* Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field.
*/
exportSubnetRoutesWithPublicIp?: pulumi.Input<boolean>;
/**
* Whether to import the custom routes from the peer network. Defaults to `false`.
*/
importCustomRoutes?: pulumi.Input<boolean>;
/**
* Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field.
*/
importSubnetRoutesWithPublicIp?: pulumi.Input<boolean>;
/**
* Name of the peering.
*/
name?: pulumi.Input<string>;
/**
* The primary network of the peering.
*/
network?: pulumi.Input<string>;
/**
* The peer network in the peering. The peer network
* may belong to a different project.
*/
peerNetwork?: pulumi.Input<string>;
/**
* Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"].
*/
stackType?: pulumi.Input<string>;
/**
* State for the peering, either `ACTIVE` or `INACTIVE`. The peering is
* `ACTIVE` when there's a matching configuration in the peer network.
*/
state?: pulumi.Input<string>;
/**
* Details about the current state of the peering.
*/
stateDetails?: pulumi.Input<string>;
/**
* The update strategy determines the semantics for updates and deletes to the peering connection configuration. The default value is INDEPENDENT. Possible values: ["INDEPENDENT", "CONSENSUS"]
*/
updateStrategy?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkPeering resource.
*/
export interface NetworkPeeringArgs {
/**
* Whether to export the custom routes to the peer network. Defaults to `false`.
*/
exportCustomRoutes?: pulumi.Input<boolean>;
/**
* Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field.
*/
exportSubnetRoutesWithPublicIp?: pulumi.Input<boolean>;
/**
* Whether to import the custom routes from the peer network. Defaults to `false`.
*/
importCustomRoutes?: pulumi.Input<boolean>;
/**
* Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field.
*/
importSubnetRoutesWithPublicIp?: pulumi.Input<boolean>;
/**
* Name of the peering.
*/
name?: pulumi.Input<string>;
/**
* The primary network of the peering.
*/
network: pulumi.Input<string>;
/**
* The peer network in the peering. The peer network
* may belong to a different project.
*/
peerNetwork: pulumi.Input<string>;
/**
* Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: ["IPV4_ONLY", "IPV4_IPV6"].
*/
stackType?: pulumi.Input<string>;
/**
* The update strategy determines the semantics for updates and deletes to the peering connection configuration. The default value is INDEPENDENT. Possible values: ["INDEPENDENT", "CONSENSUS"]
*/
updateStrategy?: pulumi.Input<string>;
}