akamai.getAppSecSelectableHostnames
Scopes: Security configuration; contract; group
Returns the list of hostnames that can be (but aren’t yet) protected by a security configuration. You can specify the set of hostnames to be retrieved either by supplying the name of a security configuration or by supplying an Akamai group ID and contract ID.
Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/selectable-hostnames
Output Options
The following options can be used to determine the information returned, and how that returned information is formatted:
hostnames
. List of selectable hostnames.hostnames_json
. JSON-formatted list of selectable hostnames.output_text
. Tabular report of the selectable hostnames showing the name and config_id of the security configuration under which the host is protected in production.
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 selectableHostnamesAppSecSelectableHostnames = Akamai.GetAppSecSelectableHostnames.Invoke(new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
});
var selectableHostnamesForCreateConfigurationAppSecSelectableHostnames = Akamai.GetAppSecSelectableHostnames.Invoke(new()
{
ContractId = "5-2WA382",
GroupId = 12198,
});
return new Dictionary<string, object?>
{
["selectableHostnames"] = selectableHostnamesAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.Hostnames),
["selectableHostnamesJson"] = selectableHostnamesAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.HostnamesJson),
["selectableHostnamesOutputText"] = selectableHostnamesAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.OutputText),
["selectableHostnamesForCreateConfiguration"] = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.Hostnames),
["selectableHostnamesForCreateConfigurationJson"] = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.HostnamesJson),
["selectableHostnamesForCreateConfigurationOutputText"] = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.Apply(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.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
}
selectableHostnamesAppSecSelectableHostnames, err := akamai.GetAppSecSelectableHostnames(ctx, &akamai.GetAppSecSelectableHostnamesArgs{
ConfigId: pulumi.IntRef(configuration.ConfigId),
}, nil)
if err != nil {
return err
}
ctx.Export("selectableHostnames", selectableHostnamesAppSecSelectableHostnames.Hostnames)
ctx.Export("selectableHostnamesJson", selectableHostnamesAppSecSelectableHostnames.HostnamesJson)
ctx.Export("selectableHostnamesOutputText", selectableHostnamesAppSecSelectableHostnames.OutputText)
selectableHostnamesForCreateConfigurationAppSecSelectableHostnames, err := akamai.GetAppSecSelectableHostnames(ctx, &akamai.GetAppSecSelectableHostnamesArgs{
ContractId: "5-2WA382",
GroupId: 12198,
}, nil)
if err != nil {
return err
}
ctx.Export("selectableHostnamesForCreateConfiguration", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.Hostnames)
ctx.Export("selectableHostnamesForCreateConfigurationJson", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.HostnamesJson)
ctx.Export("selectableHostnamesForCreateConfigurationOutputText", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.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.GetAppSecSelectableHostnamesArgs;
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 selectableHostnamesAppSecSelectableHostnames = AkamaiFunctions.getAppSecSelectableHostnames(GetAppSecSelectableHostnamesArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.build());
ctx.export("selectableHostnames", selectableHostnamesAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.hostnames()));
ctx.export("selectableHostnamesJson", selectableHostnamesAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.hostnamesJson()));
ctx.export("selectableHostnamesOutputText", selectableHostnamesAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.outputText()));
final var selectableHostnamesForCreateConfigurationAppSecSelectableHostnames = AkamaiFunctions.getAppSecSelectableHostnames(GetAppSecSelectableHostnamesArgs.builder()
.contractId("5-2WA382")
.groupId(12198)
.build());
ctx.export("selectableHostnamesForCreateConfiguration", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.hostnames()));
ctx.export("selectableHostnamesForCreateConfigurationJson", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.hostnamesJson()));
ctx.export("selectableHostnamesForCreateConfigurationOutputText", selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.outputText()));
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
selectable_hostnames_app_sec_selectable_hostnames = akamai.get_app_sec_selectable_hostnames(config_id=configuration.config_id)
pulumi.export("selectableHostnames", selectable_hostnames_app_sec_selectable_hostnames.hostnames)
pulumi.export("selectableHostnamesJson", selectable_hostnames_app_sec_selectable_hostnames.hostnames_json)
pulumi.export("selectableHostnamesOutputText", selectable_hostnames_app_sec_selectable_hostnames.output_text)
selectable_hostnames_for_create_configuration_app_sec_selectable_hostnames = akamai.get_app_sec_selectable_hostnames(contract_id="5-2WA382",
group_id=12198)
pulumi.export("selectableHostnamesForCreateConfiguration", selectable_hostnames_for_create_configuration_app_sec_selectable_hostnames.hostnames)
pulumi.export("selectableHostnamesForCreateConfigurationJson", selectable_hostnames_for_create_configuration_app_sec_selectable_hostnames.hostnames_json)
pulumi.export("selectableHostnamesForCreateConfigurationOutputText", selectable_hostnames_for_create_configuration_app_sec_selectable_hostnames.output_text)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const selectableHostnamesAppSecSelectableHostnames = configuration.then(configuration => akamai.getAppSecSelectableHostnames({
configId: configuration.configId,
}));
export const selectableHostnames = selectableHostnamesAppSecSelectableHostnames.then(selectableHostnamesAppSecSelectableHostnames => selectableHostnamesAppSecSelectableHostnames.hostnames);
export const selectableHostnamesJson = selectableHostnamesAppSecSelectableHostnames.then(selectableHostnamesAppSecSelectableHostnames => selectableHostnamesAppSecSelectableHostnames.hostnamesJson);
export const selectableHostnamesOutputText = selectableHostnamesAppSecSelectableHostnames.then(selectableHostnamesAppSecSelectableHostnames => selectableHostnamesAppSecSelectableHostnames.outputText);
const selectableHostnamesForCreateConfigurationAppSecSelectableHostnames = akamai.getAppSecSelectableHostnames({
contractId: "5-2WA382",
groupId: 12198,
});
export const selectableHostnamesForCreateConfiguration = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.then(selectableHostnamesForCreateConfigurationAppSecSelectableHostnames => selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.hostnames);
export const selectableHostnamesForCreateConfigurationJson = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.then(selectableHostnamesForCreateConfigurationAppSecSelectableHostnames => selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.hostnamesJson);
export const selectableHostnamesForCreateConfigurationOutputText = selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.then(selectableHostnamesForCreateConfigurationAppSecSelectableHostnames => selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.outputText);
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
selectableHostnamesAppSecSelectableHostnames:
fn::invoke:
Function: akamai:getAppSecSelectableHostnames
Arguments:
configId: ${configuration.configId}
selectableHostnamesForCreateConfigurationAppSecSelectableHostnames:
fn::invoke:
Function: akamai:getAppSecSelectableHostnames
Arguments:
contractId: 5-2WA382
groupId: 12198
outputs:
selectableHostnames: ${selectableHostnamesAppSecSelectableHostnames.hostnames} # USE CASE: User wants to view all the unprotected hostnames.
selectableHostnamesJson: ${selectableHostnamesAppSecSelectableHostnames.hostnamesJson} # USE CASE: user wants to view the same list of unprotected hostnames, in tabular form
selectableHostnamesOutputText: ${selectableHostnamesAppSecSelectableHostnames.outputText} # USE CASE: User wants to view the list of hosts available for the specified contract and contract group before creating a new security configuration.
selectableHostnamesForCreateConfiguration: ${selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.hostnames} # USE CASE: User wants to view the available hostnames in JSON format.
selectableHostnamesForCreateConfigurationJson: ${selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.hostnamesJson} # USE CASE: User wants to view the available hostnames in a table.
selectableHostnamesForCreateConfigurationOutputText: ${selectableHostnamesForCreateConfigurationAppSecSelectableHostnames.outputText}
Using getAppSecSelectableHostnames
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 getAppSecSelectableHostnames(args: GetAppSecSelectableHostnamesArgs, opts?: InvokeOptions): Promise<GetAppSecSelectableHostnamesResult>
function getAppSecSelectableHostnamesOutput(args: GetAppSecSelectableHostnamesOutputArgs, opts?: InvokeOptions): Output<GetAppSecSelectableHostnamesResult>
def get_app_sec_selectable_hostnames(active_in_production: Optional[bool] = None,
active_in_staging: Optional[bool] = None,
config_id: Optional[int] = None,
contractid: Optional[str] = None,
groupid: Optional[int] = None,
opts: Optional[InvokeOptions] = None) -> GetAppSecSelectableHostnamesResult
def get_app_sec_selectable_hostnames_output(active_in_production: Optional[pulumi.Input[bool]] = None,
active_in_staging: Optional[pulumi.Input[bool]] = None,
config_id: Optional[pulumi.Input[int]] = None,
contractid: Optional[pulumi.Input[str]] = None,
groupid: Optional[pulumi.Input[int]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAppSecSelectableHostnamesResult]
func GetAppSecSelectableHostnames(ctx *Context, args *GetAppSecSelectableHostnamesArgs, opts ...InvokeOption) (*GetAppSecSelectableHostnamesResult, error)
func GetAppSecSelectableHostnamesOutput(ctx *Context, args *GetAppSecSelectableHostnamesOutputArgs, opts ...InvokeOption) GetAppSecSelectableHostnamesResultOutput
> Note: This function is named GetAppSecSelectableHostnames
in the Go SDK.
public static class GetAppSecSelectableHostnames
{
public static Task<GetAppSecSelectableHostnamesResult> InvokeAsync(GetAppSecSelectableHostnamesArgs args, InvokeOptions? opts = null)
public static Output<GetAppSecSelectableHostnamesResult> Invoke(GetAppSecSelectableHostnamesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAppSecSelectableHostnamesResult> getAppSecSelectableHostnames(GetAppSecSelectableHostnamesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: akamai:index/getAppSecSelectableHostnames:getAppSecSelectableHostnames
arguments:
# arguments dictionary
The following arguments are supported:
- Active
In boolProduction - Active
In boolStaging - Config
Id int . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- Contractid string
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- Groupid int
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
- Active
In boolProduction - Active
In boolStaging - Config
Id int . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- Contractid string
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- Groupid int
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
- active
In BooleanProduction - active
In BooleanStaging - config
Id Integer . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- contractid String
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- groupid Integer
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
- active
In booleanProduction - active
In booleanStaging - config
Id number . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- contractid string
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- groupid number
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
- active_
in_ boolproduction - active_
in_ boolstaging - config_
id int . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- contractid str
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- groupid int
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
- active
In BooleanProduction - active
In BooleanStaging - config
Id Number . Unique identifier of the security configuration you want to return hostname information for. If not included, information is returned for all your security configurations. Note that argument can't be used with either the
contractid
or thegroupid
arguments.- contractid String
. Unique identifier of the Akamai contract you want to return hostname information for. If not included, information is returned for all the Akamai contracts associated with your account. Note that this argument can't be used with the
config_id
argument.- groupid Number
. Unique identifier of the contract group you want to return hostname information for. If not included, information is returned for all your contract groups. (Or, if you include the
contractid
argument, all the groups associated with the specified contract.) Note that this argument can't be used with theconfig_id
argument.
getAppSecSelectableHostnames Result
The following output properties are available:
- Hostnames List<string>
- Hostnames
Json string - Id string
The provider-assigned unique ID for this managed resource.
- Output
Text string - Active
In boolProduction - Active
In boolStaging - Config
Id int - Contractid string
- Groupid int
- Hostnames []string
- Hostnames
Json string - Id string
The provider-assigned unique ID for this managed resource.
- Output
Text string - Active
In boolProduction - Active
In boolStaging - Config
Id int - Contractid string
- Groupid int
- hostnames List<String>
- hostnames
Json String - id String
The provider-assigned unique ID for this managed resource.
- output
Text String - active
In BooleanProduction - active
In BooleanStaging - config
Id Integer - contractid String
- groupid Integer
- hostnames string[]
- hostnames
Json string - id string
The provider-assigned unique ID for this managed resource.
- output
Text string - active
In booleanProduction - active
In booleanStaging - config
Id number - contractid string
- groupid number
- hostnames Sequence[str]
- hostnames_
json str - id str
The provider-assigned unique ID for this managed resource.
- output_
text str - active_
in_ boolproduction - active_
in_ boolstaging - config_
id int - contractid str
- groupid int
- hostnames List<String>
- hostnames
Json String - id String
The provider-assigned unique ID for this managed resource.
- output
Text String - active
In BooleanProduction - active
In BooleanStaging - config
Id Number - contractid String
- groupid Number
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.