akamai.getNetworkLists

Use the akamai.getNetworkLists data source to retrieve information about the available network lists, optionally filtered by list type or based on a search string. The information available is described in List network lists.

Example Usage

Basic usage

using System.Collections.Generic;
using Pulumi;
using Akamai = Pulumi.Akamai;

return await Deployment.RunAsync(() => 
{
    var networkLists = Akamai.GetNetworkLists.Invoke();

    var networkListsFilter = Akamai.GetNetworkLists.Invoke(new()
    {
        Name = "Test Whitelist",
        Type = "IP",
    });

    return new Dictionary<string, object?>
    {
        ["networkListsText"] = networkLists.Apply(getNetworkListsResult => getNetworkListsResult.OutputText),
        ["networkListsJson"] = networkLists.Apply(getNetworkListsResult => getNetworkListsResult.Json),
        ["networkListsList"] = networkLists.Apply(getNetworkListsResult => getNetworkListsResult.Lists),
        ["networkListsFilterText"] = networkListsFilter.Apply(getNetworkListsResult => getNetworkListsResult.OutputText),
        ["networkListsFilterJson"] = networkListsFilter.Apply(getNetworkListsResult => getNetworkListsResult.Json),
        ["networkListsFilterList"] = networkListsFilter.Apply(getNetworkListsResult => getNetworkListsResult.Lists),
    };
});
package main

import (
	"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		networkLists, err := akamai.GetNetworkLists(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("networkListsText", networkLists.OutputText)
		ctx.Export("networkListsJson", networkLists.Json)
		ctx.Export("networkListsList", networkLists.Lists)
		networkListsFilter, err := akamai.GetNetworkLists(ctx, &akamai.GetNetworkListsArgs{
			Name: pulumi.StringRef("Test Whitelist"),
			Type: pulumi.StringRef("IP"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("networkListsFilterText", networkListsFilter.OutputText)
		ctx.Export("networkListsFilterJson", networkListsFilter.Json)
		ctx.Export("networkListsFilterList", networkListsFilter.Lists)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.akamai.AkamaiFunctions;
import com.pulumi.akamai.inputs.GetNetworkListsArgs;
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 networkLists = AkamaiFunctions.getNetworkLists();

        ctx.export("networkListsText", networkLists.applyValue(getNetworkListsResult -> getNetworkListsResult.outputText()));
        ctx.export("networkListsJson", networkLists.applyValue(getNetworkListsResult -> getNetworkListsResult.json()));
        ctx.export("networkListsList", networkLists.applyValue(getNetworkListsResult -> getNetworkListsResult.lists()));
        final var networkListsFilter = AkamaiFunctions.getNetworkLists(GetNetworkListsArgs.builder()
            .name("Test Whitelist")
            .type("IP")
            .build());

        ctx.export("networkListsFilterText", networkListsFilter.applyValue(getNetworkListsResult -> getNetworkListsResult.outputText()));
        ctx.export("networkListsFilterJson", networkListsFilter.applyValue(getNetworkListsResult -> getNetworkListsResult.json()));
        ctx.export("networkListsFilterList", networkListsFilter.applyValue(getNetworkListsResult -> getNetworkListsResult.lists()));
    }
}
import pulumi
import pulumi_akamai as akamai

network_lists = akamai.get_network_lists()
pulumi.export("networkListsText", network_lists.output_text)
pulumi.export("networkListsJson", network_lists.json)
pulumi.export("networkListsList", network_lists.lists)
network_lists_filter = akamai.get_network_lists(name="Test Whitelist",
    type="IP")
pulumi.export("networkListsFilterText", network_lists_filter.output_text)
pulumi.export("networkListsFilterJson", network_lists_filter.json)
pulumi.export("networkListsFilterList", network_lists_filter.lists)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const networkLists = akamai.getNetworkLists({});
export const networkListsText = networkLists.then(networkLists => networkLists.outputText);
export const networkListsJson = networkLists.then(networkLists => networkLists.json);
export const networkListsList = networkLists.then(networkLists => networkLists.lists);
const networkListsFilter = akamai.getNetworkLists({
    name: "Test Whitelist",
    type: "IP",
});
export const networkListsFilterText = networkListsFilter.then(networkListsFilter => networkListsFilter.outputText);
export const networkListsFilterJson = networkListsFilter.then(networkListsFilter => networkListsFilter.json);
export const networkListsFilterList = networkListsFilter.then(networkListsFilter => networkListsFilter.lists);
variables:
  networkLists:
    fn::invoke:
      Function: akamai:getNetworkLists
      Arguments: {}
  networkListsFilter:
    fn::invoke:
      Function: akamai:getNetworkLists
      Arguments:
        name: Test Whitelist
        type: IP
outputs:
  # tabular data of id, name, type, elementCount, syncPoint, readonly
  networkListsText: ${networkLists.outputText}
  networkListsJson: ${networkLists.json}
  # custom output of network list ids
  networkListsList: ${networkLists.lists}
  networkListsFilterText: ${networkListsFilter.outputText}
  networkListsFilterJson: ${networkListsFilter.json}
  # custom output of single network list id
  networkListsFilterList: ${networkListsFilter.lists}

Using getNetworkLists

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 getNetworkLists(args: GetNetworkListsArgs, opts?: InvokeOptions): Promise<GetNetworkListsResult>
function getNetworkListsOutput(args: GetNetworkListsOutputArgs, opts?: InvokeOptions): Output<GetNetworkListsResult>
def get_network_lists(name: Optional[str] = None,
                      network_list_id: Optional[str] = None,
                      type: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetNetworkListsResult
def get_network_lists_output(name: Optional[pulumi.Input[str]] = None,
                      network_list_id: Optional[pulumi.Input[str]] = None,
                      type: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetNetworkListsResult]
func GetNetworkLists(ctx *Context, args *GetNetworkListsArgs, opts ...InvokeOption) (*GetNetworkListsResult, error)
func GetNetworkListsOutput(ctx *Context, args *GetNetworkListsOutputArgs, opts ...InvokeOption) GetNetworkListsResultOutput

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

public static class GetNetworkLists 
{
    public static Task<GetNetworkListsResult> InvokeAsync(GetNetworkListsArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkListsResult> Invoke(GetNetworkListsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkListsResult> getNetworkLists(GetNetworkListsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: akamai:index/getNetworkLists:getNetworkLists
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

NetworkListId string

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

Type string

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

Name string

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

NetworkListId string

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

Type string

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

name String

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

networkListId String

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

type String

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

name string

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

networkListId string

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

type string

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

name str

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

network_list_id str

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

type str

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

name String

The name of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

networkListId String

The ID of a specific network list to retrieve. If not supplied, information about all network lists will be returned.

type String

The type of network lists to be retrieved; must be either "IP" or "GEO". If not supplied, information about both types will be returned.

getNetworkLists Result

The following output properties are available:

ContractId string
GroupId int
Id string

The provider-assigned unique ID for this managed resource.

Json string

A JSON-formatted list of information about the specified network list(s).

Lists List<string>

A list containing the IDs of the specified network lists(s).

NetworkListId string
OutputText string

A tabular display showing the network list information.

Name string
Type string
ContractId string
GroupId int
Id string

The provider-assigned unique ID for this managed resource.

Json string

A JSON-formatted list of information about the specified network list(s).

Lists []string

A list containing the IDs of the specified network lists(s).

NetworkListId string
OutputText string

A tabular display showing the network list information.

Name string
Type string
contractId String
groupId Integer
id String

The provider-assigned unique ID for this managed resource.

json String

A JSON-formatted list of information about the specified network list(s).

lists List<String>

A list containing the IDs of the specified network lists(s).

networkListId String
outputText String

A tabular display showing the network list information.

name String
type String
contractId string
groupId number
id string

The provider-assigned unique ID for this managed resource.

json string

A JSON-formatted list of information about the specified network list(s).

lists string[]

A list containing the IDs of the specified network lists(s).

networkListId string
outputText string

A tabular display showing the network list information.

name string
type string
contract_id str
group_id int
id str

The provider-assigned unique ID for this managed resource.

json str

A JSON-formatted list of information about the specified network list(s).

lists Sequence[str]

A list containing the IDs of the specified network lists(s).

network_list_id str
output_text str

A tabular display showing the network list information.

name str
type str
contractId String
groupId Number
id String

The provider-assigned unique ID for this managed resource.

json String

A JSON-formatted list of information about the specified network list(s).

lists List<String>

A list containing the IDs of the specified network lists(s).

networkListId String
outputText String

A tabular display showing the network list information.

name String
type String

Package Details

Repository
Akamai pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.