Package com.pulumi.gcp.compute
Class Network
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.compute.Network
-
public class Network extends com.pulumi.resources.CustomResource
Manages a VPC network or legacy network resource on GCP. To get more information about Network, see: * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networks) * How-to Guides * [Official Documentation](https://cloud.google.com/vpc/docs/vpc) ## Example Usage ### Network Basic ```java 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"); } } ``` ### Network Custom Mtu ```java 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()); } } ``` ### Network Custom Firewall Enforcement Order ```java 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 Network can be imported using any of these accepted formats ```sh $ pulumi import gcp:compute/network:Network default projects/{{project}}/global/networks/{{name}} ``` ```sh $ pulumi import gcp:compute/network:Network default {{project}}/{{name}} ``` ```sh $ pulumi import gcp:compute/network:Network default {{name}} ```
-
-
Constructor Summary
Constructors Constructor Description Network(java.lang.String name)
Network(java.lang.String name, NetworkArgs args)
Network(java.lang.String name, NetworkArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
autoCreateSubnetworks()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
deleteDefaultRoutesOnCreate()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
description()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
enableUlaInternalIpv6()
com.pulumi.core.Output<java.lang.String>
gatewayIpv4()
static Network
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NetworkState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
internalIpv6Range()
com.pulumi.core.Output<java.lang.Integer>
mtu()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
networkFirewallPolicyEnforcementOrder()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.lang.String>
routingMode()
com.pulumi.core.Output<java.lang.String>
selfLink()
-
-
-
Constructor Detail
-
Network
public Network(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Network
public Network(java.lang.String name, @Nullable NetworkArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Network
public Network(java.lang.String name, @Nullable NetworkArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
autoCreateSubnetworks
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> autoCreateSubnetworks()
- Returns:
- When set to `true`, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the `10.128.0.0/9` address range. When set to `false`, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources.
-
deleteDefaultRoutesOnCreate
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> deleteDefaultRoutesOnCreate()
- Returns:
- If set to `true`, default routes (`0.0.0.0/0`) will be deleted immediately after network creation. Defaults to `false`.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- An optional description of this resource. The resource must be recreated to modify this field.
-
enableUlaInternalIpv6
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableUlaInternalIpv6()
- Returns:
- Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20.
-
gatewayIpv4
public com.pulumi.core.Output<java.lang.String> gatewayIpv4()
- Returns:
- The gateway address for default routing out of the network. This value is selected by GCP.
-
internalIpv6Range
public com.pulumi.core.Output<java.lang.String> internalIpv6Range()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.Integer> mtu()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- 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. ***
-
networkFirewallPolicyEnforcementOrder
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> networkFirewallPolicyEnforcementOrder()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
routingMode
public com.pulumi.core.Output<java.lang.String> routingMode()
- Returns:
- 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 to `GLOBAL`, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values are: `REGIONAL`, `GLOBAL`.
-
selfLink
public com.pulumi.core.Output<java.lang.String> selfLink()
- Returns:
- The URI of the created resource.
-
get
public static Network get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable NetworkState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-