akamai.AppSecCustomRuleAction
Scopes: Custom rule
Associates an action with a custom rule. Custom rules are rules that you define yourself and are not part of the Kona Rule Set.
Related API Endpoint: /appsec/v1/configs/{configId}/custom-rules
Example Usage
Basic usage
using System.Collections.Generic;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var configuration = Akamai.GetAppSecConfiguration.Invoke(new()
{
Name = "Documentation",
});
var createCustomRuleAction = new Akamai.AppSecCustomRuleAction("createCustomRuleAction", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
SecurityPolicyId = "gms1_134637",
CustomRuleId = 12345,
CustomRuleAction = "alert",
});
return new Dictionary<string, object?>
{
["customRuleId"] = createCustomRuleAction.CustomRuleId,
};
});
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 {
configuration, err := akamai.LookupAppSecConfiguration(ctx, &akamai.LookupAppSecConfigurationArgs{
Name: pulumi.StringRef("Documentation"),
}, nil)
if err != nil {
return err
}
createCustomRuleAction, err := akamai.NewAppSecCustomRuleAction(ctx, "createCustomRuleAction", &akamai.AppSecCustomRuleActionArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
SecurityPolicyId: pulumi.String("gms1_134637"),
CustomRuleId: pulumi.Int(12345),
CustomRuleAction: pulumi.String("alert"),
})
if err != nil {
return err
}
ctx.Export("customRuleId", createCustomRuleAction.CustomRuleId)
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.GetAppSecConfigurationArgs;
import com.pulumi.akamai.AppSecCustomRuleAction;
import com.pulumi.akamai.AppSecCustomRuleActionArgs;
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 configuration = AkamaiFunctions.getAppSecConfiguration(GetAppSecConfigurationArgs.builder()
.name("Documentation")
.build());
var createCustomRuleAction = new AppSecCustomRuleAction("createCustomRuleAction", AppSecCustomRuleActionArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.securityPolicyId("gms1_134637")
.customRuleId(12345)
.customRuleAction("alert")
.build());
ctx.export("customRuleId", createCustomRuleAction.customRuleId());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
create_custom_rule_action = akamai.AppSecCustomRuleAction("createCustomRuleAction",
config_id=configuration.config_id,
security_policy_id="gms1_134637",
custom_rule_id=12345,
custom_rule_action="alert")
pulumi.export("customRuleId", create_custom_rule_action.custom_rule_id)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const createCustomRuleAction = new akamai.AppSecCustomRuleAction("createCustomRuleAction", {
configId: configuration.then(configuration => configuration.configId),
securityPolicyId: "gms1_134637",
customRuleId: 12345,
customRuleAction: "alert",
});
export const customRuleId = createCustomRuleAction.customRuleId;
resources:
createCustomRuleAction:
type: akamai:AppSecCustomRuleAction
properties:
configId: ${configuration.configId}
securityPolicyId: gms1_134637
customRuleId: 12345
customRuleAction: alert
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
outputs:
customRuleId: ${createCustomRuleAction.customRuleId}
Create AppSecCustomRuleAction Resource
new AppSecCustomRuleAction(name: string, args: AppSecCustomRuleActionArgs, opts?: CustomResourceOptions);
@overload
def AppSecCustomRuleAction(resource_name: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
custom_rule_action: Optional[str] = None,
custom_rule_id: Optional[int] = None,
security_policy_id: Optional[str] = None)
@overload
def AppSecCustomRuleAction(resource_name: str,
args: AppSecCustomRuleActionArgs,
opts: Optional[ResourceOptions] = None)
func NewAppSecCustomRuleAction(ctx *Context, name string, args AppSecCustomRuleActionArgs, opts ...ResourceOption) (*AppSecCustomRuleAction, error)
public AppSecCustomRuleAction(string name, AppSecCustomRuleActionArgs args, CustomResourceOptions? opts = null)
public AppSecCustomRuleAction(String name, AppSecCustomRuleActionArgs args)
public AppSecCustomRuleAction(String name, AppSecCustomRuleActionArgs args, CustomResourceOptions options)
type: akamai:AppSecCustomRuleAction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecCustomRuleActionArgs
- 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 AppSecCustomRuleActionArgs
- 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 AppSecCustomRuleActionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecCustomRuleActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppSecCustomRuleActionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppSecCustomRuleAction 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 AppSecCustomRuleAction resource accepts the following input properties:
- Config
Id int . Unique identifier of the security configuration associated with the custom rule action being modified.
- Custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- Custom
Rule intId . Unique identifier of the custom rule whose action is being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- Config
Id int . Unique identifier of the security configuration associated with the custom rule action being modified.
- Custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- Custom
Rule intId . Unique identifier of the custom rule whose action is being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id Integer . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule StringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule IntegerId . Unique identifier of the custom rule whose action is being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id number . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule numberId . Unique identifier of the custom rule whose action is being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config_
id int . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom_
rule_ straction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom_
rule_ intid . Unique identifier of the custom rule whose action is being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id Number . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule StringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule NumberId . Unique identifier of the custom rule whose action is being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the custom rule action being modified.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppSecCustomRuleAction 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 string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing AppSecCustomRuleAction Resource
Get an existing AppSecCustomRuleAction 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?: AppSecCustomRuleActionState, opts?: CustomResourceOptions): AppSecCustomRuleAction
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
custom_rule_action: Optional[str] = None,
custom_rule_id: Optional[int] = None,
security_policy_id: Optional[str] = None) -> AppSecCustomRuleAction
func GetAppSecCustomRuleAction(ctx *Context, name string, id IDInput, state *AppSecCustomRuleActionState, opts ...ResourceOption) (*AppSecCustomRuleAction, error)
public static AppSecCustomRuleAction Get(string name, Input<string> id, AppSecCustomRuleActionState? state, CustomResourceOptions? opts = null)
public static AppSecCustomRuleAction get(String name, Output<String> id, AppSecCustomRuleActionState 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 security configuration associated with the custom rule action being modified.
- Custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- Custom
Rule intId . Unique identifier of the custom rule whose action is being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- Config
Id int . Unique identifier of the security configuration associated with the custom rule action being modified.
- Custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- Custom
Rule intId . Unique identifier of the custom rule whose action is being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id Integer . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule StringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule IntegerId . Unique identifier of the custom rule whose action is being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id number . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule stringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule numberId . Unique identifier of the custom rule whose action is being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the custom rule action being modified.
- config_
id int . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom_
rule_ straction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom_
rule_ intid . Unique identifier of the custom rule whose action is being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the custom rule action being modified.
- config
Id Number . Unique identifier of the security configuration associated with the custom rule action being modified.
- custom
Rule StringAction . Action to be taken when the custom rule is invoked. Allowed values 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.
- custom
Rule NumberId . Unique identifier of the custom rule whose action is being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the custom rule action being modified.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.