1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vmwareengine
  5. NetworkPolicy
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.vmwareengine.NetworkPolicy

Explore with Pulumi AI

Represents a network policy resource. Network policies are regional resources.

To get more information about NetworkPolicy, see:

Example Usage

Vmware Engine Network Policy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
    name: "sample-network",
    location: "global",
    type: "STANDARD",
    description: "VMwareEngine standard network sample",
});
const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
    location: "us-west1",
    name: "sample-network-policy",
    edgeServicesCidr: "192.168.30.0/26",
    vmwareEngineNetwork: network_policy_nw.id,
});
Copy
import pulumi
import pulumi_gcp as gcp

network_policy_nw = gcp.vmwareengine.Network("network-policy-nw",
    name="sample-network",
    location="global",
    type="STANDARD",
    description="VMwareEngine standard network sample")
vmw_engine_network_policy = gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy",
    location="us-west1",
    name="sample-network-policy",
    edge_services_cidr="192.168.30.0/26",
    vmware_engine_network=network_policy_nw.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/vmwareengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		network_policy_nw, err := vmwareengine.NewNetwork(ctx, "network-policy-nw", &vmwareengine.NetworkArgs{
			Name:        pulumi.String("sample-network"),
			Location:    pulumi.String("global"),
			Type:        pulumi.String("STANDARD"),
			Description: pulumi.String("VMwareEngine standard network sample"),
		})
		if err != nil {
			return err
		}
		_, err = vmwareengine.NewNetworkPolicy(ctx, "vmw-engine-network-policy", &vmwareengine.NetworkPolicyArgs{
			Location:            pulumi.String("us-west1"),
			Name:                pulumi.String("sample-network-policy"),
			EdgeServicesCidr:    pulumi.String("192.168.30.0/26"),
			VmwareEngineNetwork: network_policy_nw.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var network_policy_nw = new Gcp.VMwareEngine.Network("network-policy-nw", new()
    {
        Name = "sample-network",
        Location = "global",
        Type = "STANDARD",
        Description = "VMwareEngine standard network sample",
    });

    var vmw_engine_network_policy = new Gcp.VMwareEngine.NetworkPolicy("vmw-engine-network-policy", new()
    {
        Location = "us-west1",
        Name = "sample-network-policy",
        EdgeServicesCidr = "192.168.30.0/26",
        VmwareEngineNetwork = network_policy_nw.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vmwareengine.Network;
import com.pulumi.gcp.vmwareengine.NetworkArgs;
import com.pulumi.gcp.vmwareengine.NetworkPolicy;
import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs;
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 network_policy_nw = new Network("network-policy-nw", NetworkArgs.builder()
            .name("sample-network")
            .location("global")
            .type("STANDARD")
            .description("VMwareEngine standard network sample")
            .build());

        var vmw_engine_network_policy = new NetworkPolicy("vmw-engine-network-policy", NetworkPolicyArgs.builder()
            .location("us-west1")
            .name("sample-network-policy")
            .edgeServicesCidr("192.168.30.0/26")
            .vmwareEngineNetwork(network_policy_nw.id())
            .build());

    }
}
Copy
resources:
  network-policy-nw:
    type: gcp:vmwareengine:Network
    properties:
      name: sample-network
      location: global
      type: STANDARD
      description: VMwareEngine standard network sample
  vmw-engine-network-policy:
    type: gcp:vmwareengine:NetworkPolicy
    properties:
      location: us-west1
      name: sample-network-policy
      edgeServicesCidr: 192.168.30.0/26
      vmwareEngineNetwork: ${["network-policy-nw"].id}
Copy

Vmware Engine Network Policy Full

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
    name: "sample-network",
    location: "global",
    type: "STANDARD",
    description: "VMwareEngine standard network sample",
});
const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
    location: "us-west1",
    name: "sample-network-policy",
    edgeServicesCidr: "192.168.30.0/26",
    vmwareEngineNetwork: network_policy_nw.id,
    description: "Sample Network Policy",
    internetAccess: {
        enabled: true,
    },
    externalIp: {
        enabled: true,
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

network_policy_nw = gcp.vmwareengine.Network("network-policy-nw",
    name="sample-network",
    location="global",
    type="STANDARD",
    description="VMwareEngine standard network sample")
vmw_engine_network_policy = gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy",
    location="us-west1",
    name="sample-network-policy",
    edge_services_cidr="192.168.30.0/26",
    vmware_engine_network=network_policy_nw.id,
    description="Sample Network Policy",
    internet_access={
        "enabled": True,
    },
    external_ip={
        "enabled": True,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/vmwareengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		network_policy_nw, err := vmwareengine.NewNetwork(ctx, "network-policy-nw", &vmwareengine.NetworkArgs{
			Name:        pulumi.String("sample-network"),
			Location:    pulumi.String("global"),
			Type:        pulumi.String("STANDARD"),
			Description: pulumi.String("VMwareEngine standard network sample"),
		})
		if err != nil {
			return err
		}
		_, err = vmwareengine.NewNetworkPolicy(ctx, "vmw-engine-network-policy", &vmwareengine.NetworkPolicyArgs{
			Location:            pulumi.String("us-west1"),
			Name:                pulumi.String("sample-network-policy"),
			EdgeServicesCidr:    pulumi.String("192.168.30.0/26"),
			VmwareEngineNetwork: network_policy_nw.ID(),
			Description:         pulumi.String("Sample Network Policy"),
			InternetAccess: &vmwareengine.NetworkPolicyInternetAccessArgs{
				Enabled: pulumi.Bool(true),
			},
			ExternalIp: &vmwareengine.NetworkPolicyExternalIpArgs{
				Enabled: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var network_policy_nw = new Gcp.VMwareEngine.Network("network-policy-nw", new()
    {
        Name = "sample-network",
        Location = "global",
        Type = "STANDARD",
        Description = "VMwareEngine standard network sample",
    });

    var vmw_engine_network_policy = new Gcp.VMwareEngine.NetworkPolicy("vmw-engine-network-policy", new()
    {
        Location = "us-west1",
        Name = "sample-network-policy",
        EdgeServicesCidr = "192.168.30.0/26",
        VmwareEngineNetwork = network_policy_nw.Id,
        Description = "Sample Network Policy",
        InternetAccess = new Gcp.VMwareEngine.Inputs.NetworkPolicyInternetAccessArgs
        {
            Enabled = true,
        },
        ExternalIp = new Gcp.VMwareEngine.Inputs.NetworkPolicyExternalIpArgs
        {
            Enabled = true,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vmwareengine.Network;
import com.pulumi.gcp.vmwareengine.NetworkArgs;
import com.pulumi.gcp.vmwareengine.NetworkPolicy;
import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs;
import com.pulumi.gcp.vmwareengine.inputs.NetworkPolicyInternetAccessArgs;
import com.pulumi.gcp.vmwareengine.inputs.NetworkPolicyExternalIpArgs;
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 network_policy_nw = new Network("network-policy-nw", NetworkArgs.builder()
            .name("sample-network")
            .location("global")
            .type("STANDARD")
            .description("VMwareEngine standard network sample")
            .build());

        var vmw_engine_network_policy = new NetworkPolicy("vmw-engine-network-policy", NetworkPolicyArgs.builder()
            .location("us-west1")
            .name("sample-network-policy")
            .edgeServicesCidr("192.168.30.0/26")
            .vmwareEngineNetwork(network_policy_nw.id())
            .description("Sample Network Policy")
            .internetAccess(NetworkPolicyInternetAccessArgs.builder()
                .enabled(true)
                .build())
            .externalIp(NetworkPolicyExternalIpArgs.builder()
                .enabled(true)
                .build())
            .build());

    }
}
Copy
resources:
  network-policy-nw:
    type: gcp:vmwareengine:Network
    properties:
      name: sample-network
      location: global
      type: STANDARD
      description: VMwareEngine standard network sample
  vmw-engine-network-policy:
    type: gcp:vmwareengine:NetworkPolicy
    properties:
      location: us-west1
      name: sample-network-policy
      edgeServicesCidr: 192.168.30.0/26
      vmwareEngineNetwork: ${["network-policy-nw"].id}
      description: Sample Network Policy
      internetAccess:
        enabled: true
      externalIp:
        enabled: true
Copy

Create NetworkPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NetworkPolicy(name: string, args: NetworkPolicyArgs, opts?: CustomResourceOptions);
@overload
def NetworkPolicy(resource_name: str,
                  args: NetworkPolicyArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def NetworkPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  edge_services_cidr: Optional[str] = None,
                  location: Optional[str] = None,
                  vmware_engine_network: Optional[str] = None,
                  description: Optional[str] = None,
                  external_ip: Optional[NetworkPolicyExternalIpArgs] = None,
                  internet_access: Optional[NetworkPolicyInternetAccessArgs] = None,
                  name: Optional[str] = None,
                  project: Optional[str] = None)
func NewNetworkPolicy(ctx *Context, name string, args NetworkPolicyArgs, opts ...ResourceOption) (*NetworkPolicy, error)
public NetworkPolicy(string name, NetworkPolicyArgs args, CustomResourceOptions? opts = null)
public NetworkPolicy(String name, NetworkPolicyArgs args)
public NetworkPolicy(String name, NetworkPolicyArgs args, CustomResourceOptions options)
type: gcp:vmwareengine:NetworkPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NetworkPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NetworkPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NetworkPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var networkPolicyResource = new Gcp.VMwareEngine.NetworkPolicy("networkPolicyResource", new()
{
    EdgeServicesCidr = "string",
    Location = "string",
    VmwareEngineNetwork = "string",
    Description = "string",
    ExternalIp = new Gcp.VMwareEngine.Inputs.NetworkPolicyExternalIpArgs
    {
        Enabled = false,
        State = "string",
    },
    InternetAccess = new Gcp.VMwareEngine.Inputs.NetworkPolicyInternetAccessArgs
    {
        Enabled = false,
        State = "string",
    },
    Name = "string",
    Project = "string",
});
Copy
example, err := vmwareengine.NewNetworkPolicy(ctx, "networkPolicyResource", &vmwareengine.NetworkPolicyArgs{
	EdgeServicesCidr:    pulumi.String("string"),
	Location:            pulumi.String("string"),
	VmwareEngineNetwork: pulumi.String("string"),
	Description:         pulumi.String("string"),
	ExternalIp: &vmwareengine.NetworkPolicyExternalIpArgs{
		Enabled: pulumi.Bool(false),
		State:   pulumi.String("string"),
	},
	InternetAccess: &vmwareengine.NetworkPolicyInternetAccessArgs{
		Enabled: pulumi.Bool(false),
		State:   pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
})
Copy
var networkPolicyResource = new NetworkPolicy("networkPolicyResource", NetworkPolicyArgs.builder()
    .edgeServicesCidr("string")
    .location("string")
    .vmwareEngineNetwork("string")
    .description("string")
    .externalIp(NetworkPolicyExternalIpArgs.builder()
        .enabled(false)
        .state("string")
        .build())
    .internetAccess(NetworkPolicyInternetAccessArgs.builder()
        .enabled(false)
        .state("string")
        .build())
    .name("string")
    .project("string")
    .build());
Copy
network_policy_resource = gcp.vmwareengine.NetworkPolicy("networkPolicyResource",
    edge_services_cidr="string",
    location="string",
    vmware_engine_network="string",
    description="string",
    external_ip={
        "enabled": False,
        "state": "string",
    },
    internet_access={
        "enabled": False,
        "state": "string",
    },
    name="string",
    project="string")
Copy
const networkPolicyResource = new gcp.vmwareengine.NetworkPolicy("networkPolicyResource", {
    edgeServicesCidr: "string",
    location: "string",
    vmwareEngineNetwork: "string",
    description: "string",
    externalIp: {
        enabled: false,
        state: "string",
    },
    internetAccess: {
        enabled: false,
        state: "string",
    },
    name: "string",
    project: "string",
});
Copy
type: gcp:vmwareengine:NetworkPolicy
properties:
    description: string
    edgeServicesCidr: string
    externalIp:
        enabled: false
        state: string
    internetAccess:
        enabled: false
        state: string
    location: string
    name: string
    project: string
    vmwareEngineNetwork: string
Copy

NetworkPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NetworkPolicy resource accepts the following input properties:

EdgeServicesCidr This property is required. string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
Location
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
VmwareEngineNetwork
This property is required.
Changes to this property will trigger replacement.
string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
Description string
User-provided description for this network policy.
ExternalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
InternetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
Name Changes to this property will trigger replacement. string
The ID of the Network Policy.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
EdgeServicesCidr This property is required. string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
Location
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
VmwareEngineNetwork
This property is required.
Changes to this property will trigger replacement.
string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
Description string
User-provided description for this network policy.
ExternalIp NetworkPolicyExternalIpArgs
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
InternetAccess NetworkPolicyInternetAccessArgs
Network service that allows VMware workloads to access the internet. Structure is documented below.
Name Changes to this property will trigger replacement. string
The ID of the Network Policy.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
edgeServicesCidr This property is required. String
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
location
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
vmwareEngineNetwork
This property is required.
Changes to this property will trigger replacement.
String
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
description String
User-provided description for this network policy.
externalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
name Changes to this property will trigger replacement. String
The ID of the Network Policy.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
edgeServicesCidr This property is required. string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
location
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
vmwareEngineNetwork
This property is required.
Changes to this property will trigger replacement.
string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
description string
User-provided description for this network policy.
externalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
name Changes to this property will trigger replacement. string
The ID of the Network Policy.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
edge_services_cidr This property is required. str
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
location
This property is required.
Changes to this property will trigger replacement.
str
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
vmware_engine_network
This property is required.
Changes to this property will trigger replacement.
str
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
description str
User-provided description for this network policy.
external_ip NetworkPolicyExternalIpArgs
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internet_access NetworkPolicyInternetAccessArgs
Network service that allows VMware workloads to access the internet. Structure is documented below.
name Changes to this property will trigger replacement. str
The ID of the Network Policy.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
edgeServicesCidr This property is required. String
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
location
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
vmwareEngineNetwork
This property is required.
Changes to this property will trigger replacement.
String
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
description String
User-provided description for this network policy.
externalIp Property Map
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess Property Map
Network service that allows VMware workloads to access the internet. Structure is documented below.
name Changes to this property will trigger replacement. String
The ID of the Network Policy.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkPolicy resource produces the following output properties:

CreateTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
Id string
The provider-assigned unique ID for this managed resource.
Uid string
System-generated unique identifier for the resource.
UpdateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
VmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
CreateTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
Id string
The provider-assigned unique ID for this managed resource.
Uid string
System-generated unique identifier for the resource.
UpdateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
VmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime String
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
id String
The provider-assigned unique ID for this managed resource.
uid String
System-generated unique identifier for the resource.
updateTime String
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetworkCanonical String
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
id string
The provider-assigned unique ID for this managed resource.
uid string
System-generated unique identifier for the resource.
updateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
create_time str
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
id str
The provider-assigned unique ID for this managed resource.
uid str
System-generated unique identifier for the resource.
update_time str
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmware_engine_network_canonical str
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime String
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
id String
The provider-assigned unique ID for this managed resource.
uid String
System-generated unique identifier for the resource.
updateTime String
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetworkCanonical String
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}

Look up Existing NetworkPolicy Resource

Get an existing NetworkPolicy 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?: NetworkPolicyState, opts?: CustomResourceOptions): NetworkPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        description: Optional[str] = None,
        edge_services_cidr: Optional[str] = None,
        external_ip: Optional[NetworkPolicyExternalIpArgs] = None,
        internet_access: Optional[NetworkPolicyInternetAccessArgs] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        uid: Optional[str] = None,
        update_time: Optional[str] = None,
        vmware_engine_network: Optional[str] = None,
        vmware_engine_network_canonical: Optional[str] = None) -> NetworkPolicy
func GetNetworkPolicy(ctx *Context, name string, id IDInput, state *NetworkPolicyState, opts ...ResourceOption) (*NetworkPolicy, error)
public static NetworkPolicy Get(string name, Input<string> id, NetworkPolicyState? state, CustomResourceOptions? opts = null)
public static NetworkPolicy get(String name, Output<String> id, NetworkPolicyState state, CustomResourceOptions options)
resources:  _:    type: gcp:vmwareengine:NetworkPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreateTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
Description string
User-provided description for this network policy.
EdgeServicesCidr string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
ExternalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
InternetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
Location Changes to this property will trigger replacement. string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
Name Changes to this property will trigger replacement. string
The ID of the Network Policy.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Uid string
System-generated unique identifier for the resource.
UpdateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
VmwareEngineNetwork Changes to this property will trigger replacement. string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
VmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
CreateTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
Description string
User-provided description for this network policy.
EdgeServicesCidr string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
ExternalIp NetworkPolicyExternalIpArgs
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
InternetAccess NetworkPolicyInternetAccessArgs
Network service that allows VMware workloads to access the internet. Structure is documented below.
Location Changes to this property will trigger replacement. string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
Name Changes to this property will trigger replacement. string
The ID of the Network Policy.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Uid string
System-generated unique identifier for the resource.
UpdateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
VmwareEngineNetwork Changes to this property will trigger replacement. string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
VmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime String
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
description String
User-provided description for this network policy.
edgeServicesCidr String
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
externalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
location Changes to this property will trigger replacement. String
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
name Changes to this property will trigger replacement. String
The ID of the Network Policy.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
uid String
System-generated unique identifier for the resource.
updateTime String
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetwork Changes to this property will trigger replacement. String
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
vmwareEngineNetworkCanonical String
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime string
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
description string
User-provided description for this network policy.
edgeServicesCidr string
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
externalIp NetworkPolicyExternalIp
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess NetworkPolicyInternetAccess
Network service that allows VMware workloads to access the internet. Structure is documented below.
location Changes to this property will trigger replacement. string
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
name Changes to this property will trigger replacement. string
The ID of the Network Policy.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
uid string
System-generated unique identifier for the resource.
updateTime string
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetwork Changes to this property will trigger replacement. string
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
vmwareEngineNetworkCanonical string
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
create_time str
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
description str
User-provided description for this network policy.
edge_services_cidr str
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
external_ip NetworkPolicyExternalIpArgs
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internet_access NetworkPolicyInternetAccessArgs
Network service that allows VMware workloads to access the internet. Structure is documented below.
location Changes to this property will trigger replacement. str
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
name Changes to this property will trigger replacement. str
The ID of the Network Policy.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
uid str
System-generated unique identifier for the resource.
update_time str
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmware_engine_network Changes to this property will trigger replacement. str
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
vmware_engine_network_canonical str
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
createTime String
Creation time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
description String
User-provided description for this network policy.
edgeServicesCidr String
IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
externalIp Property Map
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internetAccess is also enabled. Structure is documented below.
internetAccess Property Map
Network service that allows VMware workloads to access the internet. Structure is documented below.
location Changes to this property will trigger replacement. String
The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1
name Changes to this property will trigger replacement. String
The ID of the Network Policy.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
uid String
System-generated unique identifier for the resource.
updateTime String
Last updated time of this resource. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
vmwareEngineNetwork Changes to this property will trigger replacement. String
The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} can either be a project number or a project ID.
vmwareEngineNetworkCanonical String
The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}

Supporting Types

NetworkPolicyExternalIp
, NetworkPolicyExternalIpArgs

Enabled bool
True if the service is enabled; false otherwise.
State string
(Output) State of the service. New values may be added to this enum when appropriate.
Enabled bool
True if the service is enabled; false otherwise.
State string
(Output) State of the service. New values may be added to this enum when appropriate.
enabled Boolean
True if the service is enabled; false otherwise.
state String
(Output) State of the service. New values may be added to this enum when appropriate.
enabled boolean
True if the service is enabled; false otherwise.
state string
(Output) State of the service. New values may be added to this enum when appropriate.
enabled bool
True if the service is enabled; false otherwise.
state str
(Output) State of the service. New values may be added to this enum when appropriate.
enabled Boolean
True if the service is enabled; false otherwise.
state String
(Output) State of the service. New values may be added to this enum when appropriate.

NetworkPolicyInternetAccess
, NetworkPolicyInternetAccessArgs

Enabled bool
True if the service is enabled; false otherwise.
State string
(Output) State of the service. New values may be added to this enum when appropriate.
Enabled bool
True if the service is enabled; false otherwise.
State string
(Output) State of the service. New values may be added to this enum when appropriate.
enabled Boolean
True if the service is enabled; false otherwise.
state String
(Output) State of the service. New values may be added to this enum when appropriate.
enabled boolean
True if the service is enabled; false otherwise.
state string
(Output) State of the service. New values may be added to this enum when appropriate.
enabled bool
True if the service is enabled; false otherwise.
state str
(Output) State of the service. New values may be added to this enum when appropriate.
enabled Boolean
True if the service is enabled; false otherwise.
state String
(Output) State of the service. New values may be added to this enum when appropriate.

Import

NetworkPolicy can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}

  • {{project}}/{{location}}/{{name}}

  • {{location}}/{{name}}

When using the pulumi import command, NetworkPolicy can be imported using one of the formats above. For example:

$ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}
Copy
$ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{project}}/{{location}}/{{name}}
Copy
$ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{location}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

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.