gcp.compute.Network
Explore with Pulumi AI
Manages a VPC network or legacy network resource on GCP.
To get more information about Network, see:
- API documentation
- How-to Guides
Example Usage
Network Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var vpcNetwork = new Gcp.Compute.Network("vpcNetwork");
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewNetwork(ctx, "vpcNetwork", nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var vpcNetwork = new Network("vpcNetwork");
}
}
import pulumi
import pulumi_gcp as gcp
vpc_network = gcp.compute.Network("vpcNetwork")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const vpcNetwork = new gcp.compute.Network("vpcNetwork", {});
resources:
vpcNetwork:
type: gcp:compute:Network
Network Custom Mtu
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var vpcNetwork = new Gcp.Compute.Network("vpcNetwork", new()
{
AutoCreateSubnetworks = true,
Mtu = 1460,
Project = "my-project-name",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewNetwork(ctx, "vpcNetwork", &compute.NetworkArgs{
AutoCreateSubnetworks: pulumi.Bool(true),
Mtu: pulumi.Int(1460),
Project: pulumi.String("my-project-name"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var vpcNetwork = new Network("vpcNetwork", NetworkArgs.builder()
.autoCreateSubnetworks(true)
.mtu(1460)
.project("my-project-name")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
vpc_network = gcp.compute.Network("vpcNetwork",
auto_create_subnetworks=True,
mtu=1460,
project="my-project-name")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const vpcNetwork = new gcp.compute.Network("vpcNetwork", {
autoCreateSubnetworks: true,
mtu: 1460,
project: "my-project-name",
});
resources:
vpcNetwork:
type: gcp:compute:Network
properties:
autoCreateSubnetworks: true
mtu: 1460
project: my-project-name
Network Custom Firewall Enforcement Order
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var vpcNetwork = new Gcp.Compute.Network("vpcNetwork", new()
{
AutoCreateSubnetworks = true,
NetworkFirewallPolicyEnforcementOrder = "BEFORE_CLASSIC_FIREWALL",
Project = "my-project-name",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewNetwork(ctx, "vpcNetwork", &compute.NetworkArgs{
AutoCreateSubnetworks: pulumi.Bool(true),
NetworkFirewallPolicyEnforcementOrder: pulumi.String("BEFORE_CLASSIC_FIREWALL"),
Project: pulumi.String("my-project-name"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var vpcNetwork = new Network("vpcNetwork", NetworkArgs.builder()
.autoCreateSubnetworks(true)
.networkFirewallPolicyEnforcementOrder("BEFORE_CLASSIC_FIREWALL")
.project("my-project-name")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
vpc_network = gcp.compute.Network("vpcNetwork",
auto_create_subnetworks=True,
network_firewall_policy_enforcement_order="BEFORE_CLASSIC_FIREWALL",
project="my-project-name")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const vpcNetwork = new gcp.compute.Network("vpcNetwork", {
autoCreateSubnetworks: true,
networkFirewallPolicyEnforcementOrder: "BEFORE_CLASSIC_FIREWALL",
project: "my-project-name",
});
resources:
vpcNetwork:
type: gcp:compute:Network
properties:
autoCreateSubnetworks: true
networkFirewallPolicyEnforcementOrder: BEFORE_CLASSIC_FIREWALL
project: my-project-name
Create Network Resource
new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
auto_create_subnetworks: Optional[bool] = None,
delete_default_routes_on_create: Optional[bool] = None,
description: Optional[str] = None,
enable_ula_internal_ipv6: Optional[bool] = None,
internal_ipv6_range: Optional[str] = None,
mtu: Optional[int] = None,
name: Optional[str] = None,
network_firewall_policy_enforcement_order: Optional[str] = None,
project: Optional[str] = None,
routing_mode: Optional[str] = None)
@overload
def Network(resource_name: str,
args: Optional[NetworkArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: gcp:compute:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Network resource accepts the following input properties:
- Auto
Create boolSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- Delete
Default boolRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- Description string
An optional description of this resource. The resource must be recreated to modify this field.
- Enable
Ula boolInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- Internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- Mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
- Auto
Create boolSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- Delete
Default boolRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- Description string
An optional description of this resource. The resource must be recreated to modify this field.
- Enable
Ula boolInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- Internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- Mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
- auto
Create BooleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default BooleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description String
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula BooleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- internal
Ipv6Range String When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu Integer
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall StringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode String The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
- auto
Create booleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default booleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description string
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula booleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu number
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
- auto_
create_ boolsubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete_
default_ boolroutes_ on_ create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description str
An optional description of this resource. The resource must be recreated to modify this field.
- enable_
ula_ boolinternal_ ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- internal_
ipv6_ strrange When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network_
firewall_ strpolicy_ enforcement_ order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing_
mode str The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
- auto
Create BooleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default BooleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description String
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula BooleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- internal
Ipv6Range String When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu Number
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall StringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode String The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- Id string
The provider-assigned unique ID for this managed resource.
- Self
Link string The URI of the created resource.
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- Id string
The provider-assigned unique ID for this managed resource.
- Self
Link string The URI of the created resource.
- gateway
Ipv4 String The gateway address for default routing out of the network. This value is selected by GCP.
- id String
The provider-assigned unique ID for this managed resource.
- self
Link String The URI of the created resource.
- gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- id string
The provider-assigned unique ID for this managed resource.
- self
Link string The URI of the created resource.
- gateway_
ipv4 str The gateway address for default routing out of the network. This value is selected by GCP.
- id str
The provider-assigned unique ID for this managed resource.
- self_
link str The URI of the created resource.
- gateway
Ipv4 String The gateway address for default routing out of the network. This value is selected by GCP.
- id String
The provider-assigned unique ID for this managed resource.
- self
Link String The URI of the created resource.
Look up Existing Network Resource
Get an existing Network resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_create_subnetworks: Optional[bool] = None,
delete_default_routes_on_create: Optional[bool] = None,
description: Optional[str] = None,
enable_ula_internal_ipv6: Optional[bool] = None,
gateway_ipv4: Optional[str] = None,
internal_ipv6_range: Optional[str] = None,
mtu: Optional[int] = None,
name: Optional[str] = None,
network_firewall_policy_enforcement_order: Optional[str] = None,
project: Optional[str] = None,
routing_mode: Optional[str] = None,
self_link: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Auto
Create boolSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- Delete
Default boolRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- Description string
An optional description of this resource. The resource must be recreated to modify this field.
- Enable
Ula boolInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- Internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- Mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- Self
Link string The URI of the created resource.
- Auto
Create boolSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- Delete
Default boolRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- Description string
An optional description of this resource. The resource must be recreated to modify this field.
- Enable
Ula boolInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- Internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- Mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- Self
Link string The URI of the created resource.
- auto
Create BooleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default BooleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description String
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula BooleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- gateway
Ipv4 String The gateway address for default routing out of the network. This value is selected by GCP.
- internal
Ipv6Range String When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu Integer
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall StringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode String The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- self
Link String The URI of the created resource.
- auto
Create booleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default booleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description string
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula booleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- internal
Ipv6Range string When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu number
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall stringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode string The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- self
Link string The URI of the created resource.
- auto_
create_ boolsubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete_
default_ boolroutes_ on_ create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description str
An optional description of this resource. The resource must be recreated to modify this field.
- enable_
ula_ boolinternal_ ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- gateway_
ipv4 str The gateway address for default routing out of the network. This value is selected by GCP.
- internal_
ipv6_ strrange When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu int
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network_
firewall_ strpolicy_ enforcement_ order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing_
mode str The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- self_
link str The URI of the created resource.
- auto
Create BooleanSubnetworks When set to
true
, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the10.128.0.0/9
address range. When set tofalse
, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.- delete
Default BooleanRoutes On Create If set to
true
, default routes (0.0.0.0/0
) will be deleted immediately after network creation. Defaults tofalse
.- description String
An optional description of this resource. The resource must be recreated to modify this field.
- enable
Ula BooleanInternal Ipv6 Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
- gateway
Ipv4 String The gateway address for default routing out of the network. This value is selected by GCP.
- internal
Ipv6Range String When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field.
- mtu Number
Maximum Transmission Unit in bytes. The default value is 1460 bytes. The minimum value for this field is 1300 and the maximum value is 8896 bytes (jumbo frames). Note that packets larger than 1500 bytes (standard Ethernet) can be subject to TCP-MSS clamping or dropped with an ICMP
Fragmentation-Needed
message if the packets are routed to the Internet or other VPCs with varying MTUs.- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- network
Firewall StringPolicy Enforcement Order Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is
AFTER_CLASSIC_FIREWALL
. Possible values are:BEFORE_CLASSIC_FIREWALL
,AFTER_CLASSIC_FIREWALL
.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- routing
Mode String The network-wide routing mode to use. If set to
REGIONAL
, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set toGLOBAL
, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are:REGIONAL
,GLOBAL
.- self
Link String The URI of the created resource.
Import
Network can be imported using any of these accepted formats
$ pulumi import gcp:compute/network:Network default projects/{{project}}/global/networks/{{name}}
$ pulumi import gcp:compute/network:Network default {{project}}/{{name}}
$ pulumi import gcp:compute/network:Network default {{name}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.