AppSecCustomDeny

Scopes: Custom deny

Modifies a custom deny action. Custom denies enable you to craft your own error message or redirect pages for 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:

  • custom_deny_id. ID of the new custom deny action.

Example Usage

using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var customDeny = new Akamai.AppSecCustomDeny("customDeny", new Akamai.AppSecCustomDenyArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            CustomDeny = File.ReadAllText($"{path.Module}/custom_deny.json"),
        });
        this.CustomDenyId = customDeny.CustomDenyId;
    }

    [Output("customDenyId")]
    public Output<string> CustomDenyId { get; set; }
}
package main

import (
	"fmt"
	"io/ioutil"

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

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "Documentation"
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		customDeny, err := akamai.NewAppSecCustomDeny(ctx, "customDeny", &akamai.AppSecCustomDenyArgs{
			ConfigId:   pulumi.Int(configuration.ConfigId),
			CustomDeny: readFileOrPanic(fmt.Sprintf("%v%v", path.Module, "/custom_deny.json")),
		})
		if err != nil {
			return err
		}
		ctx.Export("customDenyId", customDeny.CustomDenyId)
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
custom_deny = akamai.AppSecCustomDeny("customDeny",
    config_id=configuration.config_id,
    custom_deny=(lambda path: open(path).read())(f"{path['module']}/custom_deny.json"))
pulumi.export("customDenyId", custom_deny.custom_deny_id)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * from "fs";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const customDeny = new akamai.AppSecCustomDeny("customDeny", {
    configId: configuration.then(configuration => configuration.configId),
    customDeny: fs.readFileSync(`${path.module}/custom_deny.json`),
});
export const customDenyId = customDeny.customDenyId;

Create a AppSecCustomDeny Resource

new AppSecCustomDeny(name: string, args: AppSecCustomDenyArgs, opts?: CustomResourceOptions);
@overload
def AppSecCustomDeny(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     config_id: Optional[int] = None,
                     custom_deny: Optional[str] = None)
@overload
def AppSecCustomDeny(resource_name: str,
                     args: AppSecCustomDenyArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAppSecCustomDeny(ctx *Context, name string, args AppSecCustomDenyArgs, opts ...ResourceOption) (*AppSecCustomDeny, error)
public AppSecCustomDeny(string name, AppSecCustomDenyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AppSecCustomDenyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AppSecCustomDenyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AppSecCustomDenyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppSecCustomDenyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AppSecCustomDeny Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AppSecCustomDeny resource accepts the following input properties:

ConfigId int
. Unique identifier of the security configuration associated with the custom deny.
CustomDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
ConfigId int
. Unique identifier of the security configuration associated with the custom deny.
CustomDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
configId number
. Unique identifier of the security configuration associated with the custom deny.
customDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
config_id int
. Unique identifier of the security configuration associated with the custom deny.
custom_deny str
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.

Outputs

All input properties are implicitly available as output properties. Additionally, the AppSecCustomDeny resource produces the following output properties:

CustomDenyId string
custom_deny_id
Id string
The provider-assigned unique ID for this managed resource.
CustomDenyId string
custom_deny_id
Id string
The provider-assigned unique ID for this managed resource.
customDenyId string
custom_deny_id
id string
The provider-assigned unique ID for this managed resource.
custom_deny_id str
custom_deny_id
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing AppSecCustomDeny Resource

Get an existing AppSecCustomDeny resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AppSecCustomDenyState, opts?: CustomResourceOptions): AppSecCustomDeny
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        custom_deny: Optional[str] = None,
        custom_deny_id: Optional[str] = None) -> AppSecCustomDeny
func GetAppSecCustomDeny(ctx *Context, name string, id IDInput, state *AppSecCustomDenyState, opts ...ResourceOption) (*AppSecCustomDeny, error)
public static AppSecCustomDeny Get(string name, Input<string> id, AppSecCustomDenyState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ConfigId int
. Unique identifier of the security configuration associated with the custom deny.
CustomDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
CustomDenyId string
custom_deny_id
ConfigId int
. Unique identifier of the security configuration associated with the custom deny.
CustomDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
CustomDenyId string
custom_deny_id
configId number
. Unique identifier of the security configuration associated with the custom deny.
customDeny string
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
customDenyId string
custom_deny_id
config_id int
. Unique identifier of the security configuration associated with the custom deny.
custom_deny str
. Path to a JSON file containing properties and property values for the custom deny. For more information, see the CustomDeny members section of the Application Security API documentation.
custom_deny_id str
custom_deny_id

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes
This Pulumi package is based on the akamai Terraform Provider.