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

getAppSecRules

Use the akamai.getAppSecRules data source to list the action and condition-exception information for a rule or rules.

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 rule = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecRules.InvokeAsync(new Akamai.GetAppSecRulesArgs
        {
            ConfigId = configuration.ConfigId,
            SecurityPolicyId = @var.Security_policy_id,
            RuleId = @var.Rule_id,
        })));
        this.RuleAction = akamai_appsec_rules.Rule.Rule_action;
        this.ConditionException = akamai_appsec_rules.Rule.Condition_exception;
        this.Json = akamai_appsec_rules.Rule.Json;
        this.OutputText = akamai_appsec_rules.Rule.Output_text;
    }

    [Output("ruleAction")]
    public Output<string> RuleAction { get; set; }
    [Output("conditionException")]
    public Output<string> ConditionException { get; set; }
    [Output("json")]
    public Output<string> Json { get; set; }
    [Output("outputText")]
    public Output<string> OutputText { 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
		}
		opt1 := _var.Rule_id
		_, err = akamai.GetAppSecRules(ctx, &GetAppSecRulesArgs{
			ConfigId:         configuration.ConfigId,
			SecurityPolicyId: _var.Security_policy_id,
			RuleId:           &opt1,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("ruleAction", akamai_appsec_rules.Rule.Rule_action)
		ctx.Export("conditionException", akamai_appsec_rules.Rule.Condition_exception)
		ctx.Export("json", akamai_appsec_rules.Rule.Json)
		ctx.Export("outputText", akamai_appsec_rules.Rule.Output_text)
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name=var["security_configuration"])
rule = akamai.get_app_sec_rules(config_id=configuration.config_id,
    security_policy_id=var["security_policy_id"],
    rule_id=var["rule_id"])
pulumi.export("ruleAction", akamai_appsec_rules["rule"]["rule_action"])
pulumi.export("conditionException", akamai_appsec_rules["rule"]["condition_exception"])
pulumi.export("json", akamai_appsec_rules["rule"]["json"])
pulumi.export("outputText", akamai_appsec_rules["rule"]["output_text"])
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: _var.security_configuration,
});
const rule = configuration.then(configuration => akamai.getAppSecRules({
    configId: configuration.configId,
    securityPolicyId: _var.security_policy_id,
    ruleId: _var.rule_id,
}));
export const ruleAction = akamai_appsec_rules.rule.rule_action;
export const conditionException = akamai_appsec_rules.rule.condition_exception;
export const json = akamai_appsec_rules.rule.json;
export const outputText = akamai_appsec_rules.rule.output_text;

Using getAppSecRules

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 getAppSecRules(args: GetAppSecRulesArgs, opts?: InvokeOptions): Promise<GetAppSecRulesResult>
function getAppSecRulesOutput(args: GetAppSecRulesOutputArgs, opts?: InvokeOptions): Output<GetAppSecRulesResult>
def get_app_sec_rules(config_id: Optional[int] = None,
                      rule_id: Optional[int] = None,
                      security_policy_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetAppSecRulesResult
def get_app_sec_rules_output(config_id: Optional[pulumi.Input[int]] = None,
                      rule_id: Optional[pulumi.Input[int]] = None,
                      security_policy_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetAppSecRulesResult]
func GetAppSecRules(ctx *Context, args *GetAppSecRulesArgs, opts ...InvokeOption) (*GetAppSecRulesResult, error)
func GetAppSecRulesOutput(ctx *Context, args *GetAppSecRulesOutputArgs, opts ...InvokeOption) GetAppSecRulesResultOutput

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

public static class GetAppSecRules 
{
    public static Task<GetAppSecRulesResult> InvokeAsync(GetAppSecRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetAppSecRulesResult> Invoke(GetAppSecRulesInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
RuleId int
The ID of the rule to use. If not specified, information about all rules will be returned.
ConfigId int
The ID of the security configuration to use.
SecurityPolicyId string
The ID of the security policy to use.
RuleId int
The ID of the rule to use. If not specified, information about all rules will be returned.
configId number
The ID of the security configuration to use.
securityPolicyId string
The ID of the security policy to use.
ruleId number
The ID of the rule to use. If not specified, information about all rules will be returned.
config_id int
The ID of the security configuration to use.
security_policy_id str
The ID of the security policy to use.
rule_id int
The ID of the rule to use. If not specified, information about all rules will be returned.

getAppSecRules Result

The following output properties are available:

ConditionException string
The rule’s conditions and exceptions.
ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
A JSON-formatted list of the action and condition-exception information for the specified rule. This output is only generated if a rule is specified.
OutputText string
A tabular display showing, for the specified rule or rules, the rule action and boolean values indicating whether conditions and exceptions are present.
RuleAction string
The rule’s action, either alert, deny, or none.
SecurityPolicyId string
RuleId int
ConditionException string
The rule’s conditions and exceptions.
ConfigId int
Id string
The provider-assigned unique ID for this managed resource.
Json string
A JSON-formatted list of the action and condition-exception information for the specified rule. This output is only generated if a rule is specified.
OutputText string
A tabular display showing, for the specified rule or rules, the rule action and boolean values indicating whether conditions and exceptions are present.
RuleAction string
The rule’s action, either alert, deny, or none.
SecurityPolicyId string
RuleId int
conditionException string
The rule’s conditions and exceptions.
configId number
id string
The provider-assigned unique ID for this managed resource.
json string
A JSON-formatted list of the action and condition-exception information for the specified rule. This output is only generated if a rule is specified.
outputText string
A tabular display showing, for the specified rule or rules, the rule action and boolean values indicating whether conditions and exceptions are present.
ruleAction string
The rule’s action, either alert, deny, or none.
securityPolicyId string
ruleId number
condition_exception str
The rule’s conditions and exceptions.
config_id int
id str
The provider-assigned unique ID for this managed resource.
json str
A JSON-formatted list of the action and condition-exception information for the specified rule. This output is only generated if a rule is specified.
output_text str
A tabular display showing, for the specified rule or rules, the rule action and boolean values indicating whether conditions and exceptions are present.
rule_action str
The rule’s action, either alert, deny, or none.
security_policy_id str
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.