1. Packages
  2. Zscaler Private Access (ZPA)
  3. API Docs
  4. getTrustedNetwork
Zscaler Private Access v0.0.12 published on Tuesday, Jul 30, 2024 by Zscaler

zpa.getTrustedNetwork

Explore with Pulumi AI

zpa logo
Zscaler Private Access v0.0.12 published on Tuesday, Jul 30, 2024 by Zscaler

    The zpa_trusted_network data source to get information about a trusted network created in the Zscaler Private Access Mobile Portal. This data source can then be referenced within the following resources:

    1. Access Policy
    2. Forwarding Policy
    3. Inspection Policy
    4. Isolation Policy
    5. Service Edge Group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as zpa from "@pulumi/zpa";
    
    const example = zpa.getTrustedNetwork({
        name: "trusted_network_name",
    });
    
    import pulumi
    import pulumi_zpa as zpa
    
    example = zpa.get_trusted_network(name="trusted_network_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/zscaler/pulumi-zpa/sdk/go/zpa"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := zpa.GetTrustedNetwork(ctx, &zpa.GetTrustedNetworkArgs{
    			Name: pulumi.StringRef("trusted_network_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zpa = Pulumi.Zpa;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Zpa.GetTrustedNetwork.Invoke(new()
        {
            Name = "trusted_network_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.ZpaFunctions;
    import com.pulumi.zpa.inputs.GetTrustedNetworkArgs;
    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 example = ZpaFunctions.getTrustedNetwork(GetTrustedNetworkArgs.builder()
                .name("trusted_network_name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: zpa:getTrustedNetwork
          Arguments:
            name: trusted_network_name
    

    NOTE To query trusted network that are associated with a specific Zscaler cloud, it is required to append the cloud name to the name of the trusted network as the below example:

    import * as pulumi from "@pulumi/pulumi";
    import * as zpa from "@pulumi/zpa";
    
    const example1 = zpa.getTrustedNetwork({
        name: "Corporate-Network (zscalertwo.net)",
    });
    export const zpaTrustedNetwork = example1.then(example1 => example1.networkId);
    
    import pulumi
    import pulumi_zpa as zpa
    
    example1 = zpa.get_trusted_network(name="Corporate-Network (zscalertwo.net)")
    pulumi.export("zpaTrustedNetwork", example1.network_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/zscaler/pulumi-zpa/sdk/go/zpa"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example1, err := zpa.GetTrustedNetwork(ctx, &zpa.GetTrustedNetworkArgs{
    			Name: pulumi.StringRef("Corporate-Network (zscalertwo.net)"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("zpaTrustedNetwork", example1.NetworkId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zpa = Pulumi.Zpa;
    
    return await Deployment.RunAsync(() => 
    {
        var example1 = Zpa.GetTrustedNetwork.Invoke(new()
        {
            Name = "Corporate-Network (zscalertwo.net)",
        });
    
        return new Dictionary<string, object?>
        {
            ["zpaTrustedNetwork"] = example1.Apply(getTrustedNetworkResult => getTrustedNetworkResult.NetworkId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.ZpaFunctions;
    import com.pulumi.zpa.inputs.GetTrustedNetworkArgs;
    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 example1 = ZpaFunctions.getTrustedNetwork(GetTrustedNetworkArgs.builder()
                .name("Corporate-Network (zscalertwo.net)")
                .build());
    
            ctx.export("zpaTrustedNetwork", example1.applyValue(getTrustedNetworkResult -> getTrustedNetworkResult.networkId()));
        }
    }
    
    variables:
      example1:
        fn::invoke:
          Function: zpa:getTrustedNetwork
          Arguments:
            name: Corporate-Network (zscalertwo.net)
    outputs:
      zpaTrustedNetwork: ${example1.networkId}
    

    Using getTrustedNetwork

    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 getTrustedNetwork(args: GetTrustedNetworkArgs, opts?: InvokeOptions): Promise<GetTrustedNetworkResult>
    function getTrustedNetworkOutput(args: GetTrustedNetworkOutputArgs, opts?: InvokeOptions): Output<GetTrustedNetworkResult>
    def get_trusted_network(id: Optional[str] = None,
                            name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetTrustedNetworkResult
    def get_trusted_network_output(id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetTrustedNetworkResult]
    func GetTrustedNetwork(ctx *Context, args *GetTrustedNetworkArgs, opts ...InvokeOption) (*GetTrustedNetworkResult, error)
    func GetTrustedNetworkOutput(ctx *Context, args *GetTrustedNetworkOutputArgs, opts ...InvokeOption) GetTrustedNetworkResultOutput

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

    public static class GetTrustedNetwork 
    {
        public static Task<GetTrustedNetworkResult> InvokeAsync(GetTrustedNetworkArgs args, InvokeOptions? opts = null)
        public static Output<GetTrustedNetworkResult> Invoke(GetTrustedNetworkInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTrustedNetworkResult> getTrustedNetwork(GetTrustedNetworkArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: zpa:index/getTrustedNetwork:getTrustedNetwork
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    Id string
    Name string
    id String
    name String
    id string
    name string
    id str
    name str
    id String
    name String

    getTrustedNetwork Result

    The following output properties are available:

    CreationTime string
    Domain string
    ModifiedTime string
    Modifiedby string
    NetworkId string
    ZscalerCloud string
    Id string
    Name string
    CreationTime string
    Domain string
    ModifiedTime string
    Modifiedby string
    NetworkId string
    ZscalerCloud string
    Id string
    Name string
    creationTime String
    domain String
    modifiedTime String
    modifiedby String
    networkId String
    zscalerCloud String
    id String
    name String
    creationTime string
    domain string
    modifiedTime string
    modifiedby string
    networkId string
    zscalerCloud string
    id string
    name string
    creationTime String
    domain String
    modifiedTime String
    modifiedby String
    networkId String
    zscalerCloud String
    id String
    name String

    Package Details

    Repository
    zpa zscaler/pulumi-zpa
    License
    MIT
    Notes
    This Pulumi package is based on the zpa Terraform Provider.
    zpa logo
    Zscaler Private Access v0.0.12 published on Tuesday, Jul 30, 2024 by Zscaler