Show / Hide Table of Contents

Class NetworkPeering

Manages a network peering within GCE. For more information see the official documentation and API.

Both network must create a peering with each other for the peering to be functional.

Subnets IP ranges across peered VPC networks cannot overlap.

Example Usage

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var @default = new Gcp.Compute.Network("default", new Gcp.Compute.NetworkArgs
    {
        AutoCreateSubnetworks = "false",
    });
    var other = new Gcp.Compute.Network("other", new Gcp.Compute.NetworkArgs
    {
        AutoCreateSubnetworks = "false",
    });
    var peering1 = new Gcp.Compute.NetworkPeering("peering1", new Gcp.Compute.NetworkPeeringArgs
    {
        Network = @default.Id,
        PeerNetwork = other.Id,
    });
    var peering2 = new Gcp.Compute.NetworkPeering("peering2", new Gcp.Compute.NetworkPeeringArgs
    {
        Network = other.Id,
        PeerNetwork = @default.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NetworkPeering
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class NetworkPeering : CustomResource

Constructors

View Source

NetworkPeering(String, NetworkPeeringArgs, CustomResourceOptions)

Create a NetworkPeering resource with the given unique name, arguments, and options.

Declaration
public NetworkPeering(string name, NetworkPeeringArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

NetworkPeeringArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ExportCustomRoutes

Whether to export the custom routes to the peer network. Defaults to false.

Declaration
public Output<bool?> ExportCustomRoutes { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

ImportCustomRoutes

Whether to export the custom routes from the peer network. Defaults to false.

Declaration
public Output<bool?> ImportCustomRoutes { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Name

Name of the peering.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Network

The primary network of the peering.

Declaration
public Output<string> Network { get; }
Property Value
Type Description
Output<System.String>
View Source

PeerNetwork

The peer network in the peering. The peer network may belong to a different project.

Declaration
public Output<string> PeerNetwork { get; }
Property Value
Type Description
Output<System.String>
View Source

State

State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network.

Declaration
public Output<string> State { get; }
Property Value
Type Description
Output<System.String>
View Source

StateDetails

Details about the current state of the peering.

Declaration
public Output<string> StateDetails { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, NetworkPeeringState, CustomResourceOptions)

Get an existing NetworkPeering resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static NetworkPeering Get(string name, Input<string> id, NetworkPeeringState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

NetworkPeeringState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
NetworkPeering
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.