1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vmwareengine
  5. getNetworkPolicy
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.vmwareengine.getNetworkPolicy

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

Use this data source to get details about a network policy resource.

To get more information about network policy, see:

Example Usage

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

const myNetworkPolicy = gcp.vmwareengine.getNetworkPolicy({
    name: "my-network-policy",
    location: "us-central1",
});
Copy
import pulumi
import pulumi_gcp as gcp

my_network_policy = gcp.vmwareengine.get_network_policy(name="my-network-policy",
    location="us-central1")
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 {
		_, err := vmwareengine.LookupNetworkPolicy(ctx, &vmwareengine.LookupNetworkPolicyArgs{
			Name:     "my-network-policy",
			Location: "us-central1",
		}, nil)
		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 myNetworkPolicy = Gcp.VMwareEngine.GetNetworkPolicy.Invoke(new()
    {
        Name = "my-network-policy",
        Location = "us-central1",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vmwareengine.VmwareengineFunctions;
import com.pulumi.gcp.vmwareengine.inputs.GetNetworkPolicyArgs;
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) {
        final var myNetworkPolicy = VmwareengineFunctions.getNetworkPolicy(GetNetworkPolicyArgs.builder()
            .name("my-network-policy")
            .location("us-central1")
            .build());

    }
}
Copy
variables:
  myNetworkPolicy:
    fn::invoke:
      function: gcp:vmwareengine:getNetworkPolicy
      arguments:
        name: my-network-policy
        location: us-central1
Copy

Using getNetworkPolicy

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNetworkPolicy(args: GetNetworkPolicyArgs, opts?: InvokeOptions): Promise<GetNetworkPolicyResult>
function getNetworkPolicyOutput(args: GetNetworkPolicyOutputArgs, opts?: InvokeOptions): Output<GetNetworkPolicyResult>
Copy
def get_network_policy(location: Optional[str] = None,
                       name: Optional[str] = None,
                       project: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetNetworkPolicyResult
def get_network_policy_output(location: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetNetworkPolicyResult]
Copy
func LookupNetworkPolicy(ctx *Context, args *LookupNetworkPolicyArgs, opts ...InvokeOption) (*LookupNetworkPolicyResult, error)
func LookupNetworkPolicyOutput(ctx *Context, args *LookupNetworkPolicyOutputArgs, opts ...InvokeOption) LookupNetworkPolicyResultOutput
Copy

> Note: This function is named LookupNetworkPolicy in the Go SDK.

public static class GetNetworkPolicy 
{
    public static Task<GetNetworkPolicyResult> InvokeAsync(GetNetworkPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkPolicyResult> Invoke(GetNetworkPolicyInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkPolicyResult> getNetworkPolicy(GetNetworkPolicyArgs args, InvokeOptions options)
public static Output<GetNetworkPolicyResult> getNetworkPolicy(GetNetworkPolicyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:vmwareengine/getNetworkPolicy:getNetworkPolicy
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Location This property is required. string
Location of the resource.
Name This property is required. string
Name of the resource.
Project string
Location This property is required. string
Location of the resource.
Name This property is required. string
Name of the resource.
Project string
location This property is required. String
Location of the resource.
name This property is required. String
Name of the resource.
project String
location This property is required. string
Location of the resource.
name This property is required. string
Name of the resource.
project string
location This property is required. str
Location of the resource.
name This property is required. str
Name of the resource.
project str
location This property is required. String
Location of the resource.
name This property is required. String
Name of the resource.
project String

getNetworkPolicy Result

The following output properties are available:

CreateTime string
Description string
EdgeServicesCidr string
ExternalIps []GetNetworkPolicyExternalIp
Id string
The provider-assigned unique ID for this managed resource.
InternetAccesses []GetNetworkPolicyInternetAccess
Location string
Name string
Uid string
UpdateTime string
VmwareEngineNetwork string
VmwareEngineNetworkCanonical string
Project string
createTime string
description string
edgeServicesCidr string
externalIps GetNetworkPolicyExternalIp[]
id string
The provider-assigned unique ID for this managed resource.
internetAccesses GetNetworkPolicyInternetAccess[]
location string
name string
uid string
updateTime string
vmwareEngineNetwork string
vmwareEngineNetworkCanonical string
project string
createTime String
description String
edgeServicesCidr String
externalIps List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
internetAccesses List<Property Map>
location String
name String
uid String
updateTime String
vmwareEngineNetwork String
vmwareEngineNetworkCanonical String
project String

Supporting Types

GetNetworkPolicyExternalIp

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

GetNetworkPolicyInternetAccess

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

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.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi