Akamai

Pulumi Official
Package maintained by Pulumi
v2.9.0 published on Wednesday, Apr 6, 2022 by Pulumi

AppSecConfiguration

Scopes: Contract and group

Creates a new WAP (Web Application Protector) or KSD (Kona Site Defender) security configuration. KSD security configurations start out empty (i.e., unconfigured), while WAP configurations are created using preset values. The contract referenced in the request body determines the type of configuration you can create.

In addition to manually creating a new configuration, you can use the create_from_config_id argument to clone an existing configuration.

Related API Endpoint: /appsec/v1/configs

Output Options

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

  • config_id. ID of the new security configuration.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var selectableHostnames = Output.Create(Akamai.GetAppSecSelectableHostnames.InvokeAsync(new Akamai.GetAppSecSelectableHostnamesArgs
        {
            ConfigId = "Documentation",
        }));
        var createConfig = new Akamai.AppSecConfiguration("createConfig", new Akamai.AppSecConfigurationArgs
        {
            Description = "This configuration is used as a testing environment for the documentation team.",
            ContractId = "5-2WA382",
            GroupId = 12198,
            HostNames = 
            {
                "documentation.akamai.com",
                "training.akamai.com",
            },
        });
        this.CreateConfigId = createConfig.ConfigId;
        var cloneConfig = new Akamai.AppSecConfiguration("cloneConfig", new Akamai.AppSecConfigurationArgs
        {
            Description = "This configuration is used as a testing environment for the documentation team.",
            CreateFromConfigId = data.Akamai_appsec_configuration.Configuration.Config_id,
            CreateFromVersion = data.Akamai_appsec_configuration.Configuration.Latest_version,
            ContractId = "5-2WA382",
            GroupId = 12198,
            HostNames = selectableHostnames.Apply(selectableHostnames => selectableHostnames.Hostnames),
        });
        this.CloneConfigId = cloneConfig.ConfigId;
    }

    [Output("createConfigId")]
    public Output<string> CreateConfigId { get; set; }
    [Output("cloneConfigId")]
    public Output<string> CloneConfigId { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		selectableHostnames, err := akamai.GetAppSecSelectableHostnames(ctx, &GetAppSecSelectableHostnamesArgs{
			ConfigId: pulumi.IntRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		createConfig, err := akamai.NewAppSecConfiguration(ctx, "createConfig", &akamai.AppSecConfigurationArgs{
			Description: pulumi.String("This configuration is used as a testing environment for the documentation team."),
			ContractId:  pulumi.String("5-2WA382"),
			GroupId:     pulumi.Int(12198),
			HostNames: pulumi.StringArray{
				pulumi.String("documentation.akamai.com"),
				pulumi.String("training.akamai.com"),
			},
		})
		if err != nil {
			return err
		}
		ctx.Export("createConfigId", createConfig.ConfigId)
		cloneConfig, err := akamai.NewAppSecConfiguration(ctx, "cloneConfig", &akamai.AppSecConfigurationArgs{
			Description:        pulumi.String("This configuration is used as a testing environment for the documentation team."),
			CreateFromConfigId: pulumi.Any(data.Akamai_appsec_configuration.Configuration.Config_id),
			CreateFromVersion:  pulumi.Any(data.Akamai_appsec_configuration.Configuration.Latest_version),
			ContractId:         pulumi.String("5-2WA382"),
			GroupId:            pulumi.Int(12198),
			HostNames:          interface{}(selectableHostnames.Hostnames),
		})
		if err != nil {
			return err
		}
		ctx.Export("cloneConfigId", cloneConfig.ConfigId)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_akamai as akamai

selectable_hostnames = akamai.get_app_sec_selectable_hostnames(config_id="Documentation")
create_config = akamai.AppSecConfiguration("createConfig",
    description="This configuration is used as a testing environment for the documentation team.",
    contract_id="5-2WA382",
    group_id=12198,
    host_names=[
        "documentation.akamai.com",
        "training.akamai.com",
    ])
pulumi.export("createConfigId", create_config.config_id)
clone_config = akamai.AppSecConfiguration("cloneConfig",
    description="This configuration is used as a testing environment for the documentation team.",
    create_from_config_id=data["akamai_appsec_configuration"]["configuration"]["config_id"],
    create_from_version=data["akamai_appsec_configuration"]["configuration"]["latest_version"],
    contract_id="5-2WA382",
    group_id=12198,
    host_names=selectable_hostnames.hostnames)
pulumi.export("cloneConfigId", clone_config.config_id)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const selectableHostnames = akamai.getAppSecSelectableHostnames({
    configId: "Documentation",
});
const createConfig = new akamai.AppSecConfiguration("createConfig", {
    description: "This configuration is used as a testing environment for the documentation team.",
    contractId: "5-2WA382",
    groupId: 12198,
    hostNames: [
        "documentation.akamai.com",
        "training.akamai.com",
    ],
});
export const createConfigId = createConfig.configId;
const cloneConfig = new akamai.AppSecConfiguration("cloneConfig", {
    description: "This configuration is used as a testing environment for the documentation team.",
    createFromConfigId: data.akamai_appsec_configuration.configuration.config_id,
    createFromVersion: data.akamai_appsec_configuration.configuration.latest_version,
    contractId: "5-2WA382",
    groupId: 12198,
    hostNames: selectableHostnames.then(selectableHostnames => selectableHostnames.hostnames),
});
export const cloneConfigId = cloneConfig.configId;

Coming soon!

Create a AppSecConfiguration Resource

new AppSecConfiguration(name: string, args: AppSecConfigurationArgs, opts?: CustomResourceOptions);
@overload
def AppSecConfiguration(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        contract_id: Optional[str] = None,
                        create_from_config_id: Optional[int] = None,
                        create_from_version: Optional[int] = None,
                        description: Optional[str] = None,
                        group_id: Optional[int] = None,
                        host_names: Optional[Sequence[str]] = None,
                        name: Optional[str] = None)
@overload
def AppSecConfiguration(resource_name: str,
                        args: AppSecConfigurationArgs,
                        opts: Optional[ResourceOptions] = None)
func NewAppSecConfiguration(ctx *Context, name string, args AppSecConfigurationArgs, opts ...ResourceOption) (*AppSecConfiguration, error)
public AppSecConfiguration(string name, AppSecConfigurationArgs args, CustomResourceOptions? opts = null)
public AppSecConfiguration(String name, AppSecConfigurationArgs args)
public AppSecConfiguration(String name, AppSecConfigurationArgs args, CustomResourceOptions options)
type: akamai:AppSecConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AppSecConfigurationArgs
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 AppSecConfigurationArgs
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 AppSecConfigurationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppSecConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AppSecConfigurationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AppSecConfiguration 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 AppSecConfiguration resource accepts the following input properties:

ContractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

Description string

. Brief description of the new configuration.

GroupId int

. Unique identifier of the contract group associated with the new configuration.

HostNames List<string>

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

CreateFromConfigId int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

CreateFromVersion int

. Version number of the security configuration being cloned.

Name string

. Name of the new configuration.

ContractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

Description string

. Brief description of the new configuration.

GroupId int

. Unique identifier of the contract group associated with the new configuration.

HostNames []string

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

CreateFromConfigId int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

CreateFromVersion int

. Version number of the security configuration being cloned.

Name string

. Name of the new configuration.

contractId String

. Unique identifier of the Akamai contract t associated with the new configuration.

description String

. Brief description of the new configuration.

groupId Integer

. Unique identifier of the contract group associated with the new configuration.

hostNames List

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

createFromConfigId Integer

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion Integer

. Version number of the security configuration being cloned.

name String

. Name of the new configuration.

contractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

description string

. Brief description of the new configuration.

groupId number

. Unique identifier of the contract group associated with the new configuration.

hostNames string[]

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

createFromConfigId number

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion number

. Version number of the security configuration being cloned.

name string

. Name of the new configuration.

contract_id str

. Unique identifier of the Akamai contract t associated with the new configuration.

description str

. Brief description of the new configuration.

group_id int

. Unique identifier of the contract group associated with the new configuration.

host_names Sequence[str]

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

create_from_config_id int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

create_from_version int

. Version number of the security configuration being cloned.

name str

. Name of the new configuration.

contractId String

. Unique identifier of the Akamai contract t associated with the new configuration.

description String

. Brief description of the new configuration.

groupId Number

. Unique identifier of the contract group associated with the new configuration.

hostNames List

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

createFromConfigId Number

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion Number

. Version number of the security configuration being cloned.

name String

. Name of the new configuration.

Outputs

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

ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

configId Integer
id String

The provider-assigned unique ID for this managed resource.

configId number
id string

The provider-assigned unique ID for this managed resource.

config_id int
id str

The provider-assigned unique ID for this managed resource.

configId Number
id String

The provider-assigned unique ID for this managed resource.

Look up an Existing AppSecConfiguration Resource

Get an existing AppSecConfiguration 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?: AppSecConfigurationState, opts?: CustomResourceOptions): AppSecConfiguration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        contract_id: Optional[str] = None,
        create_from_config_id: Optional[int] = None,
        create_from_version: Optional[int] = None,
        description: Optional[str] = None,
        group_id: Optional[int] = None,
        host_names: Optional[Sequence[str]] = None,
        name: Optional[str] = None) -> AppSecConfiguration
func GetAppSecConfiguration(ctx *Context, name string, id IDInput, state *AppSecConfigurationState, opts ...ResourceOption) (*AppSecConfiguration, error)
public static AppSecConfiguration Get(string name, Input<string> id, AppSecConfigurationState? state, CustomResourceOptions? opts = null)
public static AppSecConfiguration get(String name, Output<String> id, AppSecConfigurationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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
ContractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

CreateFromConfigId int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

CreateFromVersion int

. Version number of the security configuration being cloned.

Description string

. Brief description of the new configuration.

GroupId int

. Unique identifier of the contract group associated with the new configuration.

HostNames List<string>

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

Name string

. Name of the new configuration.

ConfigId int
ContractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

CreateFromConfigId int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

CreateFromVersion int

. Version number of the security configuration being cloned.

Description string

. Brief description of the new configuration.

GroupId int

. Unique identifier of the contract group associated with the new configuration.

HostNames []string

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

Name string

. Name of the new configuration.

configId Integer
contractId String

. Unique identifier of the Akamai contract t associated with the new configuration.

createFromConfigId Integer

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion Integer

. Version number of the security configuration being cloned.

description String

. Brief description of the new configuration.

groupId Integer

. Unique identifier of the contract group associated with the new configuration.

hostNames List

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

name String

. Name of the new configuration.

configId number
contractId string

. Unique identifier of the Akamai contract t associated with the new configuration.

createFromConfigId number

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion number

. Version number of the security configuration being cloned.

description string

. Brief description of the new configuration.

groupId number

. Unique identifier of the contract group associated with the new configuration.

hostNames string[]

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

name string

. Name of the new configuration.

config_id int
contract_id str

. Unique identifier of the Akamai contract t associated with the new configuration.

create_from_config_id int

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

create_from_version int

. Version number of the security configuration being cloned.

description str

. Brief description of the new configuration.

group_id int

. Unique identifier of the contract group associated with the new configuration.

host_names Sequence[str]

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

name str

. Name of the new configuration.

configId Number
contractId String

. Unique identifier of the Akamai contract t associated with the new configuration.

createFromConfigId Number

. Unique identifier of the existing configuration being cloned in order to create the new configuration.

createFromVersion Number

. Version number of the security configuration being cloned.

description String

. Brief description of the new configuration.

groupId Number

. Unique identifier of the contract group associated with the new configuration.

hostNames List

. JSON array containing the hostnames to be protected by the new configuration. You must specify at least one hostname in order to create a new configuration.

name String

. Name of the new configuration.

Package Details

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

This Pulumi package is based on the akamai Terraform Provider.