Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AppSecAttackGroup

Use the akamai.AppSecAttackGroup resource to create or modify an attack group’s action, conditions and exceptions. When the conditions are met, the rule’s actions are ignored and not applied to that specific traffic.

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 = @var.Security_configuration,
        }));
        var attackGroup = new Akamai.AppSecAttackGroup("attackGroup", new Akamai.AppSecAttackGroupArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            SecurityPolicyId = @var.Security_policy_id,
            AttackGroup = @var.Attack_group,
            AttackGroupAction = @var.Attack_group_action,
            ConditionException = File.ReadAllText($"{path.Module}/condition_exception.json"),
        });
    }

}
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 := _var.Security_configuration
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		_, err = akamai.NewAppSecAttackGroup(ctx, "attackGroup", &akamai.AppSecAttackGroupArgs{
			ConfigId:           pulumi.Int(configuration.ConfigId),
			SecurityPolicyId:   pulumi.Any(_var.Security_policy_id),
			AttackGroup:        pulumi.Any(_var.Attack_group),
			AttackGroupAction:  pulumi.Any(_var.Attack_group_action),
			ConditionException: readFileOrPanic(fmt.Sprintf("%v%v", path.Module, "/condition_exception.json")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name=var["security_configuration"])
attack_group = akamai.AppSecAttackGroup("attackGroup",
    config_id=configuration.config_id,
    security_policy_id=var["security_policy_id"],
    attack_group=var["attack_group"],
    attack_group_action=var["attack_group_action"],
    condition_exception=(lambda path: open(path).read())(f"{path['module']}/condition_exception.json"))
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * from "fs";

const configuration = akamai.getAppSecConfiguration({
    name: _var.security_configuration,
});
const attackGroup = new akamai.AppSecAttackGroup("attackGroup", {
    configId: configuration.then(configuration => configuration.configId),
    securityPolicyId: _var.security_policy_id,
    attackGroup: _var.attack_group,
    attackGroupAction: _var.attack_group_action,
    conditionException: fs.readFileSync(`${path.module}/condition_exception.json`),
});

Create a AppSecAttackGroup Resource

new AppSecAttackGroup(name: string, args: AppSecAttackGroupArgs, opts?: CustomResourceOptions);
@overload
def AppSecAttackGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      attack_group: Optional[str] = None,
                      attack_group_action: Optional[str] = None,
                      condition_exception: Optional[str] = None,
                      config_id: Optional[int] = None,
                      security_policy_id: Optional[str] = None)
@overload
def AppSecAttackGroup(resource_name: str,
                      args: AppSecAttackGroupArgs,
                      opts: Optional[ResourceOptions] = None)
func NewAppSecAttackGroup(ctx *Context, name string, args AppSecAttackGroupArgs, opts ...ResourceOption) (*AppSecAttackGroup, error)
public AppSecAttackGroup(string name, AppSecAttackGroupArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AppSecAttackGroupArgs
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 AppSecAttackGroupArgs
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 AppSecAttackGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppSecAttackGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

AttackGroup string
The attack group to use.
AttackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
ConditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
AttackGroup string
The attack group to use.
AttackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
ConditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
attackGroup string
The attack group to use.
attackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
configId number
The ID of the security configuration to use.
securityPolicyId string
The ID of the security policy to use.
conditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
attack_group str
The attack group to use.
attack_group_action str
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
config_id int
The ID of the security configuration to use.
security_policy_id str
The ID of the security policy to use.
condition_exception str
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).

Outputs

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

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

Look up an Existing AppSecAttackGroup Resource

Get an existing AppSecAttackGroup 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?: AppSecAttackGroupState, opts?: CustomResourceOptions): AppSecAttackGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attack_group: Optional[str] = None,
        attack_group_action: Optional[str] = None,
        condition_exception: Optional[str] = None,
        config_id: Optional[int] = None,
        security_policy_id: Optional[str] = None) -> AppSecAttackGroup
func GetAppSecAttackGroup(ctx *Context, name string, id IDInput, state *AppSecAttackGroupState, opts ...ResourceOption) (*AppSecAttackGroup, error)
public static AppSecAttackGroup Get(string name, Input<string> id, AppSecAttackGroupState? 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:

AttackGroup string
The attack group to use.
AttackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
ConditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
AttackGroup string
The attack group to use.
AttackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
ConditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
attackGroup string
The attack group to use.
attackGroupAction string
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
conditionException string
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
configId number
The ID of the security configuration to use.
securityPolicyId string
The ID of the security policy to use.
attack_group str
The attack group to use.
attack_group_action str
The action to be taken: alert to record the trigger of the event, deny to block the request, deny_custom_{custom_deny_id} to execute a custom deny action, or none to take no action.
condition_exception str
The name of a file containing a JSON-formatted description of the conditions and exceptions to use (format).
config_id int
The ID of the security configuration to use.
security_policy_id str
The ID of the security policy to use.

Package Details

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