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,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class NetworkPeering : CustomResource
Constructors
View SourceNetworkPeering(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 SourceExportCustomRoutes
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>> |
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>> |
Name
Name of the peering.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Network
The primary network of the peering.
Declaration
public Output<string> Network { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
StateDetails
Details about the current state of the peering.
Declaration
public Output<string> StateDetails { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |