akamai.getAppSecSelectedHostnames

Scopes: Security configuration

Returns a list of the hostnames currently protected by the specified security configuration.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/selected-hostnames

Output Options

The following options can be used to determine the information returned, and how that returned information is formatted:

  • hostnames. List of selected hostnames.
  • hostnames_json. JSON-formatted list of selected hostnames.
  • output_text. Tabular report of the selected hostnames.

Example Usage

Basic usage

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

return await Deployment.RunAsync(() => 
{
    var configuration = Akamai.GetAppSecConfiguration.Invoke(new()
    {
        Name = "Documentation",
    });

    var selectedHostnamesAppSecSelectedHostnames = Akamai.GetAppSecSelectedHostnames.Invoke(new()
    {
        ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
    });

    return new Dictionary<string, object?>
    {
        ["selectedHostnames"] = selectedHostnamesAppSecSelectedHostnames.Apply(getAppSecSelectedHostnamesResult => getAppSecSelectedHostnamesResult.Hostnames),
        ["selectedHostnamesJson"] = selectedHostnamesAppSecSelectedHostnames.Apply(getAppSecSelectedHostnamesResult => getAppSecSelectedHostnamesResult.HostnamesJson),
        ["selectedHostnamesOutputText"] = selectedHostnamesAppSecSelectedHostnames.Apply(getAppSecSelectedHostnamesResult => getAppSecSelectedHostnamesResult.OutputText),
    };
});
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 {
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &akamai.LookupAppSecConfigurationArgs{
			Name: pulumi.StringRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		selectedHostnamesAppSecSelectedHostnames, err := akamai.LookupAppSecSelectedHostnames(ctx, &akamai.LookupAppSecSelectedHostnamesArgs{
			ConfigId: configuration.ConfigId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("selectedHostnames", selectedHostnamesAppSecSelectedHostnames.Hostnames)
		ctx.Export("selectedHostnamesJson", selectedHostnamesAppSecSelectedHostnames.HostnamesJson)
		ctx.Export("selectedHostnamesOutputText", selectedHostnamesAppSecSelectedHostnames.OutputText)
		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.GetAppSecConfigurationArgs;
import com.pulumi.akamai.inputs.GetAppSecSelectedHostnamesArgs;
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 configuration = AkamaiFunctions.getAppSecConfiguration(GetAppSecConfigurationArgs.builder()
            .name("Documentation")
            .build());

        final var selectedHostnamesAppSecSelectedHostnames = AkamaiFunctions.getAppSecSelectedHostnames(GetAppSecSelectedHostnamesArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .build());

        ctx.export("selectedHostnames", selectedHostnamesAppSecSelectedHostnames.applyValue(getAppSecSelectedHostnamesResult -> getAppSecSelectedHostnamesResult.hostnames()));
        ctx.export("selectedHostnamesJson", selectedHostnamesAppSecSelectedHostnames.applyValue(getAppSecSelectedHostnamesResult -> getAppSecSelectedHostnamesResult.hostnamesJson()));
        ctx.export("selectedHostnamesOutputText", selectedHostnamesAppSecSelectedHostnames.applyValue(getAppSecSelectedHostnamesResult -> getAppSecSelectedHostnamesResult.outputText()));
    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
selected_hostnames_app_sec_selected_hostnames = akamai.get_app_sec_selected_hostnames(config_id=configuration.config_id)
pulumi.export("selectedHostnames", selected_hostnames_app_sec_selected_hostnames.hostnames)
pulumi.export("selectedHostnamesJson", selected_hostnames_app_sec_selected_hostnames.hostnames_json)
pulumi.export("selectedHostnamesOutputText", selected_hostnames_app_sec_selected_hostnames.output_text)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const selectedHostnamesAppSecSelectedHostnames = configuration.then(configuration => akamai.getAppSecSelectedHostnames({
    configId: configuration.configId,
}));
export const selectedHostnames = selectedHostnamesAppSecSelectedHostnames.then(selectedHostnamesAppSecSelectedHostnames => selectedHostnamesAppSecSelectedHostnames.hostnames);
export const selectedHostnamesJson = selectedHostnamesAppSecSelectedHostnames.then(selectedHostnamesAppSecSelectedHostnames => selectedHostnamesAppSecSelectedHostnames.hostnamesJson);
export const selectedHostnamesOutputText = selectedHostnamesAppSecSelectedHostnames.then(selectedHostnamesAppSecSelectedHostnames => selectedHostnamesAppSecSelectedHostnames.outputText);
variables:
  configuration:
    fn::invoke:
      Function: akamai:getAppSecConfiguration
      Arguments:
        name: Documentation
  selectedHostnamesAppSecSelectedHostnames:
    fn::invoke:
      Function: akamai:getAppSecSelectedHostnames
      Arguments:
        configId: ${configuration.configId}
outputs:
  selectedHostnames: ${selectedHostnamesAppSecSelectedHostnames.hostnames}
  selectedHostnamesJson: ${selectedHostnamesAppSecSelectedHostnames.hostnamesJson}
  selectedHostnamesOutputText: ${selectedHostnamesAppSecSelectedHostnames.outputText}

Using getAppSecSelectedHostnames

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 getAppSecSelectedHostnames(args: GetAppSecSelectedHostnamesArgs, opts?: InvokeOptions): Promise<GetAppSecSelectedHostnamesResult>
function getAppSecSelectedHostnamesOutput(args: GetAppSecSelectedHostnamesOutputArgs, opts?: InvokeOptions): Output<GetAppSecSelectedHostnamesResult>
def get_app_sec_selected_hostnames(config_id: Optional[int] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetAppSecSelectedHostnamesResult
def get_app_sec_selected_hostnames_output(config_id: Optional[pulumi.Input[int]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetAppSecSelectedHostnamesResult]
func LookupAppSecSelectedHostnames(ctx *Context, args *LookupAppSecSelectedHostnamesArgs, opts ...InvokeOption) (*LookupAppSecSelectedHostnamesResult, error)
func LookupAppSecSelectedHostnamesOutput(ctx *Context, args *LookupAppSecSelectedHostnamesOutputArgs, opts ...InvokeOption) LookupAppSecSelectedHostnamesResultOutput

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

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

The following arguments are supported:

ConfigId int

. Unique identifier of the security configuration associated with the protected hosts.

ConfigId int

. Unique identifier of the security configuration associated with the protected hosts.

configId Integer

. Unique identifier of the security configuration associated with the protected hosts.

configId number

. Unique identifier of the security configuration associated with the protected hosts.

config_id int

. Unique identifier of the security configuration associated with the protected hosts.

configId Number

. Unique identifier of the security configuration associated with the protected hosts.

getAppSecSelectedHostnames Result

The following output properties are available:

ConfigId int
Hostnames List<string>
HostnamesJson string
Id string

The provider-assigned unique ID for this managed resource.

OutputText string
ConfigId int
Hostnames []string
HostnamesJson string
Id string

The provider-assigned unique ID for this managed resource.

OutputText string
configId Integer
hostnames List<String>
hostnamesJson String
id String

The provider-assigned unique ID for this managed resource.

outputText String
configId number
hostnames string[]
hostnamesJson string
id string

The provider-assigned unique ID for this managed resource.

outputText string
config_id int
hostnames Sequence[str]
hostnames_json str
id str

The provider-assigned unique ID for this managed resource.

output_text str
configId Number
hostnames List<String>
hostnamesJson String
id String

The provider-assigned unique ID for this managed resource.

outputText String

Package Details

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

This Pulumi package is based on the akamai Terraform Provider.