getAppSecCustomRules

Scopes: Security configuration; custom rule

Returns a list of the custom rules defined for a security configuration; you can also use this resource to return information for an individual custom rule. Custom rules are rules you have created yourself and are not part of the Kona Rule Set.

Related API Endpoint:/appsec/v1/configs/{configId}/custom-rules

Output Options

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

  • output_text. Tabular report showing the ID and name of the custom rule information.
  • json. JSON-formatted report of the custom rule information.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var customRules = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecCustomRules.InvokeAsync(new Akamai.GetAppSecCustomRulesArgs
        {
            ConfigId = configuration.ConfigId,
        })));
        this.CustomRulesOutputText = customRules.Apply(customRules => customRules.OutputText);
        this.CustomRulesJson = customRules.Apply(customRules => customRules.Json);
        this.CustomRulesConfigId = customRules.Apply(customRules => customRules.ConfigId);
        var specificCustomRule = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecCustomRules.InvokeAsync(new Akamai.GetAppSecCustomRulesArgs
        {
            ConfigId = configuration.ConfigId,
            CustomRuleId = 60029316,
        })));
        this.SpecificCustomRuleJson = specificCustomRule.Apply(specificCustomRule => specificCustomRule.Json);
    }

    [Output("customRulesOutputText")]
    public Output<string> CustomRulesOutputText { get; set; }
    [Output("customRulesJson")]
    public Output<string> CustomRulesJson { get; set; }
    [Output("customRulesConfigId")]
    public Output<string> CustomRulesConfigId { get; set; }
    [Output("specificCustomRuleJson")]
    public Output<string> SpecificCustomRuleJson { 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 {
		opt0 := "Documentation"
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		customRules, err := akamai.GetAppSecCustomRules(ctx, &GetAppSecCustomRulesArgs{
			ConfigId: configuration.ConfigId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("customRulesOutputText", customRules.OutputText)
		ctx.Export("customRulesJson", customRules.Json)
		ctx.Export("customRulesConfigId", customRules.ConfigId)
		opt1 := 60029316
		specificCustomRule, err := akamai.GetAppSecCustomRules(ctx, &GetAppSecCustomRulesArgs{
			ConfigId:     configuration.ConfigId,
			CustomRuleId: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("specificCustomRuleJson", specificCustomRule.Json)
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
custom_rules = akamai.get_app_sec_custom_rules(config_id=configuration.config_id)
pulumi.export("customRulesOutputText", custom_rules.output_text)
pulumi.export("customRulesJson", custom_rules.json)
pulumi.export("customRulesConfigId", custom_rules.config_id)
specific_custom_rule = akamai.get_app_sec_custom_rules(config_id=configuration.config_id,
    custom_rule_id=60029316)
pulumi.export("specificCustomRuleJson", specific_custom_rule.json)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const customRules = configuration.then(configuration => akamai.getAppSecCustomRules({
    configId: configuration.configId,
}));
export const customRulesOutputText = customRules.then(customRules => customRules.outputText);
export const customRulesJson = customRules.then(customRules => customRules.json);
export const customRulesConfigId = customRules.then(customRules => customRules.configId);
const specificCustomRule = configuration.then(configuration => akamai.getAppSecCustomRules({
    configId: configuration.configId,
    customRuleId: "60029316",
}));
export const specificCustomRuleJson = specificCustomRule.then(specificCustomRule => specificCustomRule.json);

Using getAppSecCustomRules

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAppSecCustomRules(args: GetAppSecCustomRulesArgs, opts?: InvokeOptions): Promise<GetAppSecCustomRulesResult>
function getAppSecCustomRulesOutput(args: GetAppSecCustomRulesOutputArgs, opts?: InvokeOptions): Output<GetAppSecCustomRulesResult>
def get_app_sec_custom_rules(config_id: Optional[int] = None,
                             custom_rule_id: Optional[int] = None,
                             opts: Optional[InvokeOptions] = None) -> GetAppSecCustomRulesResult
def get_app_sec_custom_rules_output(config_id: Optional[pulumi.Input[int]] = None,
                             custom_rule_id: Optional[pulumi.Input[int]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetAppSecCustomRulesResult]
func GetAppSecCustomRules(ctx *Context, args *GetAppSecCustomRulesArgs, opts ...InvokeOption) (*GetAppSecCustomRulesResult, error)
func GetAppSecCustomRulesOutput(ctx *Context, args *GetAppSecCustomRulesOutputArgs, opts ...InvokeOption) GetAppSecCustomRulesResultOutput

> Note: This function is named GetAppSecCustomRules in the Go SDK.

public static class GetAppSecCustomRules 
{
    public static Task<GetAppSecCustomRulesResult> InvokeAsync(GetAppSecCustomRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetAppSecCustomRulesResult> Invoke(GetAppSecCustomRulesInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ConfigId int
. Unique identifier of the security configuration associated with the custom rules
CustomRuleId int
. Unique identifier of the custom rule you want to return information for. If not included, information is returned for all your custom rules.
ConfigId int
. Unique identifier of the security configuration associated with the custom rules
CustomRuleId int
. Unique identifier of the custom rule you want to return information for. If not included, information is returned for all your custom rules.
configId number
. Unique identifier of the security configuration associated with the custom rules
customRuleId number
. Unique identifier of the custom rule you want to return information for. If not included, information is returned for all your custom rules.
config_id int
. Unique identifier of the security configuration associated with the custom rules
custom_rule_id int
. Unique identifier of the custom rule you want to return information for. If not included, information is returned for all your custom rules.

getAppSecCustomRules Result

The following output properties are available:

ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
OutputText string
CustomRuleId int
ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
OutputText string
CustomRuleId int
configId number
id string
The provider-assigned unique ID for this managed resource.
json string
outputText string
customRuleId number
config_id int
id str
The provider-assigned unique ID for this managed resource.
json str
output_text str
custom_rule_id int

Package Details

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