akamai.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
Basic usage
using System.Collections.Generic;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var selectableHostnames = Akamai.GetAppSecSelectableHostnames.Invoke(new()
{
ConfigId = "Documentation",
});
var createConfig = new Akamai.AppSecConfiguration("createConfig", new()
{
Description = "This configuration is used as a testing environment for the documentation team.",
ContractId = "5-2WA382",
GroupId = 12198,
HostNames = new[]
{
"documentation.akamai.com",
"training.akamai.com",
},
});
var cloneConfig = new Akamai.AppSecConfiguration("cloneConfig", new()
{
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(getAppSecSelectableHostnamesResult => getAppSecSelectableHostnamesResult.Hostnames),
});
return new Dictionary<string, object?>
{
["createConfigId"] = createConfig.ConfigId,
["cloneConfigId"] = cloneConfig.ConfigId,
};
});
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 {
selectableHostnames, err := akamai.GetAppSecSelectableHostnames(ctx, &akamai.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
})
}
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.GetAppSecSelectableHostnamesArgs;
import com.pulumi.akamai.AppSecConfiguration;
import com.pulumi.akamai.AppSecConfigurationArgs;
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 selectableHostnames = AkamaiFunctions.getAppSecSelectableHostnames(GetAppSecSelectableHostnamesArgs.builder()
.configId("Documentation")
.build());
var createConfig = new AppSecConfiguration("createConfig", AppSecConfigurationArgs.builder()
.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")
.build());
ctx.export("createConfigId", createConfig.configId());
var cloneConfig = new AppSecConfiguration("cloneConfig", AppSecConfigurationArgs.builder()
.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.applyValue(getAppSecSelectableHostnamesResult -> getAppSecSelectableHostnamesResult.hostnames()))
.build());
ctx.export("cloneConfigId", cloneConfig.configId());
}
}
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;
resources:
createConfig:
type: akamai:AppSecConfiguration
properties:
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
cloneConfig:
type: akamai:AppSecConfiguration
properties:
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.hostnames}
variables:
selectableHostnames:
fn::invoke:
Function: akamai:getAppSecSelectableHostnames
Arguments:
configId: Documentation
outputs:
createConfigId: ${createConfig.configId} # USE CASE: User wants to clone a new security configuration from an existing configuration and version.
cloneConfigId: ${cloneConfig.configId}
Create 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:
- Contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- Description string
. Brief description of the new configuration.
- Group
Id int . Unique identifier of the contract group associated with the new configuration.
- Host
Names 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.
- Create
From intConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- Create
From intVersion . Version number of the security configuration being cloned.
- Name string
. Name of the new configuration.
- Contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- Description string
. Brief description of the new configuration.
- Group
Id int . Unique identifier of the contract group associated with the new configuration.
- Host
Names []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.
- Create
From intConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- Create
From intVersion . Version number of the security configuration being cloned.
- Name string
. Name of the new configuration.
- contract
Id String . Unique identifier of the Akamai contract associated with the new configuration.
- description String
. Brief description of the new configuration.
- group
Id Integer . Unique identifier of the contract group associated with the new configuration.
- host
Names 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.
- create
From IntegerConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From IntegerVersion . Version number of the security configuration being cloned.
- name String
. Name of the new configuration.
- contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- description string
. Brief description of the new configuration.
- group
Id number . Unique identifier of the contract group associated with the new configuration.
- host
Names 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.
- create
From numberConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From numberVersion . Version number of the security configuration being cloned.
- name string
. Name of the new configuration.
- contract_
id str . Unique identifier of the Akamai contract 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_ intconfig_ id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create_
from_ intversion . Version number of the security configuration being cloned.
- name str
. Name of the new configuration.
- contract
Id String . Unique identifier of the Akamai contract associated with the new configuration.
- description String
. Brief description of the new configuration.
- group
Id Number . Unique identifier of the contract group associated with the new configuration.
- host
Names 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.
- create
From NumberConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From NumberVersion . 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:
Look up 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.
- Config
Id int Unique identifier of the new security configuration
- Contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- Create
From intConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- Create
From intVersion . Version number of the security configuration being cloned.
- Description string
. Brief description of the new configuration.
- Group
Id int . Unique identifier of the contract group associated with the new configuration.
- Host
Names 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.
- Config
Id int Unique identifier of the new security configuration
- Contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- Create
From intConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- Create
From intVersion . Version number of the security configuration being cloned.
- Description string
. Brief description of the new configuration.
- Group
Id int . Unique identifier of the contract group associated with the new configuration.
- Host
Names []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 Integer Unique identifier of the new security configuration
- contract
Id String . Unique identifier of the Akamai contract associated with the new configuration.
- create
From IntegerConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From IntegerVersion . Version number of the security configuration being cloned.
- description String
. Brief description of the new configuration.
- group
Id Integer . Unique identifier of the contract group associated with the new configuration.
- host
Names 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.
- config
Id number Unique identifier of the new security configuration
- contract
Id string . Unique identifier of the Akamai contract associated with the new configuration.
- create
From numberConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From numberVersion . Version number of the security configuration being cloned.
- description string
. Brief description of the new configuration.
- group
Id number . Unique identifier of the contract group associated with the new configuration.
- host
Names 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 Unique identifier of the new security configuration
- contract_
id str . Unique identifier of the Akamai contract associated with the new configuration.
- create_
from_ intconfig_ id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create_
from_ intversion . 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.
- config
Id Number Unique identifier of the new security configuration
- contract
Id String . Unique identifier of the Akamai contract associated with the new configuration.
- create
From NumberConfig Id . Unique identifier of the existing configuration being cloned in order to create the new configuration.
- create
From NumberVersion . Version number of the security configuration being cloned.
- description String
. Brief description of the new configuration.
- group
Id Number . Unique identifier of the contract group associated with the new configuration.
- host
Names 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.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.