Network
Manages a VPC network or legacy network resource on GCP.
To get more information about Network, see:
- API documentation
- How-to Guides
Create a Network Resource
new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);def Network(resource_name, opts=None, auto_create_subnetworks=None, delete_default_routes_on_create=None, description=None, name=None, project=None, routing_mode=None, __props__=None);func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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/9address 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.
- 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.- 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.
- 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/9address 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.
- 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.- 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.
- 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/9address 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.
- 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.- 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.
- 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/9address 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.
- 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.- 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
Look up an 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): Networkstatic get(resource_name, id, opts=None, auto_create_subnetworks=None, delete_default_routes_on_create=None, description=None, gateway_ipv4=None, name=None, project=None, routing_mode=None, self_link=None, __props__=None);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)- 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.
The following state arguments are supported:
- 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/9address 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.
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- 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.- 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.- 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/9address 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.
- Gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- 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.- 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.- 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/9address 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.
- gateway
Ipv4 string The gateway address for default routing out of the network. This value is selected by GCP.
- 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.- 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.- 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/9address 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.
- gateway_
ipv4 str The gateway address for default routing out of the network. This value is selected by GCP.
- 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.- 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.- self_
link str The URI of the created resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.