getAppSecCustomRules

Use the akamai.getAppSecCustomRules data source to retrieve a list of the custom rules defined for a security configuration.

Example Usage

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 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 = @var.Custom_rule_id,
        })));
        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 := _var.Security_configuration
		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 := _var.Custom_rule_id
		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=var["security_configuration"])
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=var["custom_rule_id"])
pulumi.export("specificCustomRuleJson", specific_custom_rule.json)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: _var.security_configuration,
});
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: _var.custom_rule_id,
}));
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
The ID of the security configuration to use.
CustomRuleId int
The ID of a specific custom rule to use. If not supplied, information about all custom rules associated with the given security configuration will be returned.
ConfigId int
The ID of the security configuration to use.
CustomRuleId int
The ID of a specific custom rule to use. If not supplied, information about all custom rules associated with the given security configuration will be returned.
configId number
The ID of the security configuration to use.
customRuleId number
The ID of a specific custom rule to use. If not supplied, information about all custom rules associated with the given security configuration will be returned.
config_id int
The ID of the security configuration to use.
custom_rule_id int
The ID of a specific custom rule to use. If not supplied, information about all custom rules associated with the given security configuration will be returned.

getAppSecCustomRules Result

The following output properties are available:

ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
A JSON-formatted display of the custom rule information.
OutputText string
A tabular display showing the ID and name of the custom rule(s).
CustomRuleId int
ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
A JSON-formatted display of the custom rule information.
OutputText string
A tabular display showing the ID and name of the custom rule(s).
CustomRuleId int
configId number
id string
The provider-assigned unique ID for this managed resource.
json string
A JSON-formatted display of the custom rule information.
outputText string
A tabular display showing the ID and name of the custom rule(s).
customRuleId number
config_id int
id str
The provider-assigned unique ID for this managed resource.
json str
A JSON-formatted display of the custom rule information.
output_text str
A tabular display showing the ID and name of the custom rule(s).
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.