AppSecRatePolicyAction

Scopes: Rate policy

Creates, modifies or deletes the actions associated with a rate policy. By default, rate policies take no action when triggered. Note that you must set separate actions for requests originating from an IPv4 IP address and for requests originating from an IPv6 address.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/rate-policies/{ratePolicyId}

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 appsecRatePolicy = new Akamai.AppSecRatePolicy("appsecRatePolicy", new Akamai.AppSecRatePolicyArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            RatePolicy = File.ReadAllText($"{path.Module}/rate_policy.json"),
        });
        var appsecRatePolicyAction = new Akamai.AppSecRatePolicyAction("appsecRatePolicyAction", new Akamai.AppSecRatePolicyActionArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            SecurityPolicyId = "gms1_134637",
            RatePolicyId = appsecRatePolicy.RatePolicyId,
            Ipv4Action = "deny",
            Ipv6Action = "deny",
        });
    }

}
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
		}
		appsecRatePolicy, err := akamai.NewAppSecRatePolicy(ctx, "appsecRatePolicy", &akamai.AppSecRatePolicyArgs{
			ConfigId:   pulumi.Int(configuration.ConfigId),
			RatePolicy: readFileOrPanic(fmt.Sprintf("%v%v", path.Module, "/rate_policy.json")),
		})
		if err != nil {
			return err
		}
		_, err = akamai.NewAppSecRatePolicyAction(ctx, "appsecRatePolicyAction", &akamai.AppSecRatePolicyActionArgs{
			ConfigId:         pulumi.Int(configuration.ConfigId),
			SecurityPolicyId: pulumi.String("gms1_134637"),
			RatePolicyId:     appsecRatePolicy.RatePolicyId,
			Ipv4Action:       pulumi.String("deny"),
			Ipv6Action:       pulumi.String("deny"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
appsec_rate_policy = akamai.AppSecRatePolicy("appsecRatePolicy",
    config_id=configuration.config_id,
    rate_policy=(lambda path: open(path).read())(f"{path['module']}/rate_policy.json"))
appsec_rate_policy_action = akamai.AppSecRatePolicyAction("appsecRatePolicyAction",
    config_id=configuration.config_id,
    security_policy_id="gms1_134637",
    rate_policy_id=appsec_rate_policy.rate_policy_id,
    ipv4_action="deny",
    ipv6_action="deny")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * from "fs";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const appsecRatePolicy = new akamai.AppSecRatePolicy("appsecRatePolicy", {
    configId: configuration.then(configuration => configuration.configId),
    ratePolicy: fs.readFileSync(`${path.module}/rate_policy.json`),
});
const appsecRatePolicyAction = new akamai.AppSecRatePolicyAction("appsecRatePolicyAction", {
    configId: configuration.then(configuration => configuration.configId),
    securityPolicyId: "gms1_134637",
    ratePolicyId: appsecRatePolicy.ratePolicyId,
    ipv4Action: "deny",
    ipv6Action: "deny",
});

Create a AppSecRatePolicyAction Resource

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

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

ConfigId int
. Unique identifier of the security configuration associated with the rate policy action being modified.
Ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
Ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
RatePolicyId int
. Unique identifier of the rate policy whose action is being modified.
SecurityPolicyId string
ConfigId int
. Unique identifier of the security configuration associated with the rate policy action being modified.
Ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
Ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
RatePolicyId int
. Unique identifier of the rate policy whose action is being modified.
SecurityPolicyId string
configId number
. Unique identifier of the security configuration associated with the rate policy action being modified.
ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
ratePolicyId number
. Unique identifier of the rate policy whose action is being modified.
securityPolicyId string
config_id int
. Unique identifier of the security configuration associated with the rate policy action being modified.
ipv4_action str

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
ipv6_action str

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
rate_policy_id int
. Unique identifier of the rate policy whose action is being modified.
security_policy_id str

Outputs

All input properties are implicitly available as output properties. Additionally, the AppSecRatePolicyAction 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 AppSecRatePolicyAction Resource

Get an existing AppSecRatePolicyAction 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?: AppSecRatePolicyActionState, opts?: CustomResourceOptions): AppSecRatePolicyAction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        ipv4_action: Optional[str] = None,
        ipv6_action: Optional[str] = None,
        rate_policy_id: Optional[int] = None,
        security_policy_id: Optional[str] = None) -> AppSecRatePolicyAction
func GetAppSecRatePolicyAction(ctx *Context, name string, id IDInput, state *AppSecRatePolicyActionState, opts ...ResourceOption) (*AppSecRatePolicyAction, error)
public static AppSecRatePolicyAction Get(string name, Input<string> id, AppSecRatePolicyActionState? 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 rate policy action being modified.
Ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
Ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
RatePolicyId int
. Unique identifier of the rate policy whose action is being modified.
SecurityPolicyId string
ConfigId int
. Unique identifier of the security configuration associated with the rate policy action being modified.
Ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
Ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
RatePolicyId int
. Unique identifier of the rate policy whose action is being modified.
SecurityPolicyId string
configId number
. Unique identifier of the security configuration associated with the rate policy action being modified.
ipv4Action string

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
ipv6Action string

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
ratePolicyId number
. Unique identifier of the rate policy whose action is being modified.
securityPolicyId string
config_id int
. Unique identifier of the security configuration associated with the rate policy action being modified.
ipv4_action str

. Rate policy action for requests coming from an IPv4 IP address. Allowed actions are:

  • alert. Record the event,
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
  • none. Take no action.
ipv6_action str

. Rate policy action for requests coming from an IPv6 IP address. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
rate_policy_id int
. Unique identifier of the rate policy whose action is being modified.
security_policy_id str

Package Details

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