Akamai

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

getAppSecCustomDeny

Scopes: Security configuration; custom deny

Returns information about custom deny actions: the returned information is described in the CustomDeny members section of the Application Security API. Custom denies allow you to craft your own error messages or redirect pages to use when HTTP requests are denied.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/custom-deny

Output Options

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

  • json. JSON-formatted list of custom deny information.
  • output_text. Tabular report of the custom deny information.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var customDenyList = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecCustomDeny.InvokeAsync(new Akamai.GetAppSecCustomDenyArgs
        {
            ConfigId = configuration.ConfigId,
        })));
        this.CustomDenyListOutput = customDenyList.Apply(customDenyList => customDenyList.OutputText);
        this.CustomDenyListJson = customDenyList.Apply(customDenyList => customDenyList.Json);
        var customDeny = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecCustomDeny.InvokeAsync(new Akamai.GetAppSecCustomDenyArgs
        {
            ConfigId = configuration.ConfigId,
            CustomDenyId = "deny_custom_64386",
        })));
        this.CustomDenyJson = customDeny.Apply(customDeny => customDeny.Json);
        this.CustomDenyOutput = customDeny.Apply(customDeny => customDeny.OutputText);
    }

    [Output("customDenyListOutput")]
    public Output<string> CustomDenyListOutput { get; set; }
    [Output("customDenyListJson")]
    public Output<string> CustomDenyListJson { get; set; }
    [Output("customDenyJson")]
    public Output<string> CustomDenyJson { get; set; }
    [Output("customDenyOutput")]
    public Output<string> CustomDenyOutput { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: pulumi.StringRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		customDenyList, err := akamai.LookupAppSecCustomDeny(ctx, &GetAppSecCustomDenyArgs{
			ConfigId: configuration.ConfigId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("customDenyListOutput", customDenyList.OutputText)
		ctx.Export("customDenyListJson", customDenyList.Json)
		customDeny, err := akamai.LookupAppSecCustomDeny(ctx, &GetAppSecCustomDenyArgs{
			ConfigId:     configuration.ConfigId,
			CustomDenyId: pulumi.StringRef("deny_custom_64386"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("customDenyJson", customDeny.Json)
		ctx.Export("customDenyOutput", customDeny.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.GetAppSecCustomDenyArgs;
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 customDenyList = AkamaiFunctions.getAppSecCustomDeny(GetAppSecCustomDenyArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .build());

        ctx.export("customDenyListOutput", customDenyList.applyValue(getAppSecCustomDenyResult -> getAppSecCustomDenyResult.outputText()));
        ctx.export("customDenyListJson", customDenyList.applyValue(getAppSecCustomDenyResult -> getAppSecCustomDenyResult.json()));
        final var customDeny = AkamaiFunctions.getAppSecCustomDeny(GetAppSecCustomDenyArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .customDenyId("deny_custom_64386")
            .build());

        ctx.export("customDenyJson", customDeny.applyValue(getAppSecCustomDenyResult -> getAppSecCustomDenyResult.json()));
        ctx.export("customDenyOutput", customDeny.applyValue(getAppSecCustomDenyResult -> getAppSecCustomDenyResult.outputText()));
    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
custom_deny_list = akamai.get_app_sec_custom_deny(config_id=configuration.config_id)
pulumi.export("customDenyListOutput", custom_deny_list.output_text)
pulumi.export("customDenyListJson", custom_deny_list.json)
custom_deny = akamai.get_app_sec_custom_deny(config_id=configuration.config_id,
    custom_deny_id="deny_custom_64386")
pulumi.export("customDenyJson", custom_deny.json)
pulumi.export("customDenyOutput", custom_deny.output_text)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const customDenyList = configuration.then(configuration => akamai.getAppSecCustomDeny({
    configId: configuration.configId,
}));
export const customDenyListOutput = customDenyList.then(customDenyList => customDenyList.outputText);
export const customDenyListJson = customDenyList.then(customDenyList => customDenyList.json);
const customDeny = configuration.then(configuration => akamai.getAppSecCustomDeny({
    configId: configuration.configId,
    customDenyId: "deny_custom_64386",
}));
export const customDenyJson = customDeny.then(customDeny => customDeny.json);
export const customDenyOutput = customDeny.then(customDeny => customDeny.outputText);
variables:
  configuration:
    Fn::Invoke:
      Function: akamai:getAppSecConfiguration
      Arguments:
        name: Documentation
  customDenyList: # USE CASE: User wants to display the returned data in a table.
    Fn::Invoke:
      Function: akamai:getAppSecCustomDeny
      Arguments:
        configId: ${configuration.configId}
  customDeny:
    Fn::Invoke:
      Function: akamai:getAppSecCustomDeny
      Arguments:
        configId: ${configuration.configId}
        customDenyId: deny_custom_64386
outputs:
  customDenyListOutput: ${customDenyList.outputText}
  customDenyListJson: ${customDenyList.json} # USE CASE: User wants to view a specific custom deny associated with a security configuration.
  customDenyJson: ${customDeny.json}
  customDenyOutput: ${customDeny.outputText}

Using getAppSecCustomDeny

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 getAppSecCustomDeny(args: GetAppSecCustomDenyArgs, opts?: InvokeOptions): Promise<GetAppSecCustomDenyResult>
function getAppSecCustomDenyOutput(args: GetAppSecCustomDenyOutputArgs, opts?: InvokeOptions): Output<GetAppSecCustomDenyResult>
def get_app_sec_custom_deny(config_id: Optional[int] = None,
                            custom_deny_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAppSecCustomDenyResult
def get_app_sec_custom_deny_output(config_id: Optional[pulumi.Input[int]] = None,
                            custom_deny_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetAppSecCustomDenyResult]
func LookupAppSecCustomDeny(ctx *Context, args *LookupAppSecCustomDenyArgs, opts ...InvokeOption) (*LookupAppSecCustomDenyResult, error)
func LookupAppSecCustomDenyOutput(ctx *Context, args *LookupAppSecCustomDenyOutputArgs, opts ...InvokeOption) LookupAppSecCustomDenyResultOutput

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

public static class GetAppSecCustomDeny 
{
    public static Task<GetAppSecCustomDenyResult> InvokeAsync(GetAppSecCustomDenyArgs args, InvokeOptions? opts = null)
    public static Output<GetAppSecCustomDenyResult> Invoke(GetAppSecCustomDenyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAppSecCustomDenyResult> getAppSecCustomDeny(GetAppSecCustomDenyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: akamai:index/getAppSecCustomDeny:getAppSecCustomDeny
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ConfigId int

. Unique identifier of the security configuration associated with the custom denies.

CustomDenyId string

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

ConfigId int

. Unique identifier of the security configuration associated with the custom denies.

CustomDenyId string

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

configId Integer

. Unique identifier of the security configuration associated with the custom denies.

customDenyId String

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

configId number

. Unique identifier of the security configuration associated with the custom denies.

customDenyId string

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

config_id int

. Unique identifier of the security configuration associated with the custom denies.

custom_deny_id str

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

configId Number

. Unique identifier of the security configuration associated with the custom denies.

customDenyId String

. Unique identifier of the custom deny you want to return information for. If not included. information is returned for all your custom denies.

getAppSecCustomDeny Result

The following output properties are available:

ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
CustomDenyId string
ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
CustomDenyId string
configId Integer
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
customDenyId String
configId number
id string

The provider-assigned unique ID for this managed resource.

json string
outputText string
customDenyId string
config_id int
id str

The provider-assigned unique ID for this managed resource.

json str
output_text str
custom_deny_id str
configId Number
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
customDenyId String

Package Details

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

This Pulumi package is based on the akamai Terraform Provider.