Akamai

v3.0.0 published on Monday, Jul 25, 2022 by Pulumi

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

Coming soon!

Coming soon!

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()));
    }
}

Coming soon!

Coming soon!

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:

ActiveInProduction bool
ActiveInStaging bool
ConfigId 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 the groupid 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 the config_id argument.

ActiveInProduction bool
ActiveInStaging bool
ConfigId 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 the groupid 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 the config_id argument.

activeInProduction Boolean
activeInStaging Boolean
configId 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 the groupid 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 the config_id argument.

activeInProduction boolean
activeInStaging boolean
configId 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 the groupid 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 the config_id argument.

active_in_production bool
active_in_staging bool
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 the groupid 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 the config_id argument.

activeInProduction Boolean
activeInStaging Boolean
configId 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 the groupid 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 the config_id argument.

getAppSecSelectableHostnames Result

The following output properties are available:

Hostnames List<string>
HostnamesJson string
Id string

The provider-assigned unique ID for this managed resource.

OutputText string
ActiveInProduction bool
ActiveInStaging bool
ConfigId int
Contractid string
Groupid int
Hostnames []string
HostnamesJson string
Id string

The provider-assigned unique ID for this managed resource.

OutputText string
ActiveInProduction bool
ActiveInStaging bool
ConfigId int
Contractid string
Groupid int
hostnames List<String>
hostnamesJson String
id String

The provider-assigned unique ID for this managed resource.

outputText String
activeInProduction Boolean
activeInStaging Boolean
configId Integer
contractid String
groupid Integer
hostnames string[]
hostnamesJson string
id string

The provider-assigned unique ID for this managed resource.

outputText string
activeInProduction boolean
activeInStaging boolean
configId 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_production bool
active_in_staging bool
config_id int
contractid str
groupid int
hostnames List<String>
hostnamesJson String
id String

The provider-assigned unique ID for this managed resource.

outputText String
activeInProduction Boolean
activeInStaging Boolean
configId Number
contractid String
groupid Number

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.