1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vmwareengine
  5. getNetworkPolicy
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.vmwareengine.getNetworkPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 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",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_network_policy = gcp.vmwareengine.get_network_policy(name="my-network-policy",
        location="us-central1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      myNetworkPolicy:
        fn::invoke:
          Function: gcp:vmwareengine:getNetworkPolicy
          Arguments:
            name: my-network-policy
            location: us-central1
    

    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>
    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]
    func LookupNetworkPolicy(ctx *Context, args *LookupNetworkPolicyArgs, opts ...InvokeOption) (*LookupNetworkPolicyResult, error)
    func LookupNetworkPolicyOutput(ctx *Context, args *LookupNetworkPolicyOutputArgs, opts ...InvokeOption) LookupNetworkPolicyResultOutput

    > 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)
    }
    public static CompletableFuture<GetNetworkPolicyResult> getNetworkPolicy(GetNetworkPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:vmwareengine/getNetworkPolicy:getNetworkPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    Location of the resource.
    Name string
    Name of the resource.
    Project string
    Location string
    Location of the resource.
    Name string
    Name of the resource.
    Project string
    location String
    Location of the resource.
    name String
    Name of the resource.
    project String
    location string
    Location of the resource.
    name string
    Name of the resource.
    project string
    location str
    Location of the resource.
    name str
    Name of the resource.
    project str
    location String
    Location of the resource.
    name 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 bool
    True if the service is enabled; false otherwise.
    State string
    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
    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
    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
    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
    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
    State of the service. New values may be added to this enum when appropriate.

    GetNetworkPolicyInternetAccess

    Enabled bool
    True if the service is enabled; false otherwise.
    State string
    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
    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
    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
    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
    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
    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.
    gcp logo
    Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi