Expand description
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
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder().name("vpc-network").build_struct(),
);
}
§Network Custom Mtu
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder()
.auto_create_subnetworks(true)
.mtu(1460)
.name("vpc-network")
.project("my-project-name")
.build_struct(),
);
}
§Network Custom Firewall Enforcement Order
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder()
.auto_create_subnetworks(true)
.name("vpc-network")
.network_firewall_policy_enforcement_order("BEFORE_CLASSIC_FIREWALL")
.project("my-project-name")
.build_struct(),
);
}
§Network Bgp Best Path Selection Mode
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder()
.name("vpc-network")
.project("my-project-name")
.routing_mode("GLOBAL")
.build_struct(),
);
}
§Network Bgp Best Path Selection Mode Standard
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder()
.bgp_best_path_selection_mode("STANDARD")
.name("vpc-network")
.project("my-project-name")
.routing_mode("GLOBAL")
.build_struct(),
);
}
§Network Bgp Best Path Selection Mode Standard Custom Fields
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let vpcNetwork = network::create(
"vpcNetwork",
NetworkArgs::builder()
.bgp_always_compare_med(true)
.bgp_best_path_selection_mode("STANDARD")
.bgp_inter_region_cost("ADD_COST_TO_MED")
.name("vpc-network")
.project("my-project-name")
.routing_mode("GLOBAL")
.build_struct(),
);
}
§Import
Network can be imported using any of these accepted formats:
-
projects/{{project}}/global/networks/{{name}}
-
{{project}}/{{name}}
-
{{name}}
When using the pulumi import
command, Network can be imported using one of the formats above. For example:
$ 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}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments