1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Waas
  5. getCustomProtectionRules
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.Waas.getCustomProtectionRules

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

This data source provides the list of Custom Protection Rules in Oracle Cloud Infrastructure Web Application Acceleration and Security service.

Gets a list of custom protection rules for the specified Web Application Firewall.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testCustomProtectionRules = oci.Waas.getCustomProtectionRules({
    compartmentId: compartmentId,
    displayNames: customProtectionRuleDisplayNames,
    ids: customProtectionRuleIds,
    states: customProtectionRuleStates,
    timeCreatedGreaterThanOrEqualTo: customProtectionRuleTimeCreatedGreaterThanOrEqualTo,
    timeCreatedLessThan: customProtectionRuleTimeCreatedLessThan,
});
Copy
import pulumi
import pulumi_oci as oci

test_custom_protection_rules = oci.Waas.get_custom_protection_rules(compartment_id=compartment_id,
    display_names=custom_protection_rule_display_names,
    ids=custom_protection_rule_ids,
    states=custom_protection_rule_states,
    time_created_greater_than_or_equal_to=custom_protection_rule_time_created_greater_than_or_equal_to,
    time_created_less_than=custom_protection_rule_time_created_less_than)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/waas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := waas.GetCustomProtectionRules(ctx, &waas.GetCustomProtectionRulesArgs{
			CompartmentId:                   compartmentId,
			DisplayNames:                    customProtectionRuleDisplayNames,
			Ids:                             customProtectionRuleIds,
			States:                          customProtectionRuleStates,
			TimeCreatedGreaterThanOrEqualTo: pulumi.StringRef(customProtectionRuleTimeCreatedGreaterThanOrEqualTo),
			TimeCreatedLessThan:             pulumi.StringRef(customProtectionRuleTimeCreatedLessThan),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testCustomProtectionRules = Oci.Waas.GetCustomProtectionRules.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayNames = customProtectionRuleDisplayNames,
        Ids = customProtectionRuleIds,
        States = customProtectionRuleStates,
        TimeCreatedGreaterThanOrEqualTo = customProtectionRuleTimeCreatedGreaterThanOrEqualTo,
        TimeCreatedLessThan = customProtectionRuleTimeCreatedLessThan,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Waas.WaasFunctions;
import com.pulumi.oci.Waas.inputs.GetCustomProtectionRulesArgs;
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 testCustomProtectionRules = WaasFunctions.getCustomProtectionRules(GetCustomProtectionRulesArgs.builder()
            .compartmentId(compartmentId)
            .displayNames(customProtectionRuleDisplayNames)
            .ids(customProtectionRuleIds)
            .states(customProtectionRuleStates)
            .timeCreatedGreaterThanOrEqualTo(customProtectionRuleTimeCreatedGreaterThanOrEqualTo)
            .timeCreatedLessThan(customProtectionRuleTimeCreatedLessThan)
            .build());

    }
}
Copy
variables:
  testCustomProtectionRules:
    fn::invoke:
      function: oci:Waas:getCustomProtectionRules
      arguments:
        compartmentId: ${compartmentId}
        displayNames: ${customProtectionRuleDisplayNames}
        ids: ${customProtectionRuleIds}
        states: ${customProtectionRuleStates}
        timeCreatedGreaterThanOrEqualTo: ${customProtectionRuleTimeCreatedGreaterThanOrEqualTo}
        timeCreatedLessThan: ${customProtectionRuleTimeCreatedLessThan}
Copy

Using getCustomProtectionRules

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 getCustomProtectionRules(args: GetCustomProtectionRulesArgs, opts?: InvokeOptions): Promise<GetCustomProtectionRulesResult>
function getCustomProtectionRulesOutput(args: GetCustomProtectionRulesOutputArgs, opts?: InvokeOptions): Output<GetCustomProtectionRulesResult>
Copy
def get_custom_protection_rules(compartment_id: Optional[str] = None,
                                display_names: Optional[Sequence[str]] = None,
                                filters: Optional[Sequence[_waas.GetCustomProtectionRulesFilter]] = None,
                                ids: Optional[Sequence[str]] = None,
                                states: Optional[Sequence[str]] = None,
                                time_created_greater_than_or_equal_to: Optional[str] = None,
                                time_created_less_than: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetCustomProtectionRulesResult
def get_custom_protection_rules_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                display_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                filters: Optional[pulumi.Input[Sequence[pulumi.Input[_waas.GetCustomProtectionRulesFilterArgs]]]] = None,
                                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                states: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                time_created_greater_than_or_equal_to: Optional[pulumi.Input[str]] = None,
                                time_created_less_than: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetCustomProtectionRulesResult]
Copy
func GetCustomProtectionRules(ctx *Context, args *GetCustomProtectionRulesArgs, opts ...InvokeOption) (*GetCustomProtectionRulesResult, error)
func GetCustomProtectionRulesOutput(ctx *Context, args *GetCustomProtectionRulesOutputArgs, opts ...InvokeOption) GetCustomProtectionRulesResultOutput
Copy

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

public static class GetCustomProtectionRules 
{
    public static Task<GetCustomProtectionRulesResult> InvokeAsync(GetCustomProtectionRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetCustomProtectionRulesResult> Invoke(GetCustomProtectionRulesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetCustomProtectionRulesResult> getCustomProtectionRules(GetCustomProtectionRulesArgs args, InvokeOptions options)
public static Output<GetCustomProtectionRulesResult> getCustomProtectionRules(GetCustomProtectionRulesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Waas/getCustomProtectionRules:getCustomProtectionRules
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
DisplayNames List<string>
Filter custom protection rules using a list of display names.
Filters Changes to this property will trigger replacement. List<GetCustomProtectionRulesFilter>
Ids List<string>
Filter custom protection rules using a list of custom protection rule OCIDs.
States List<string>
Filter Custom Protection rules using a list of lifecycle states.
TimeCreatedGreaterThanOrEqualTo string
A filter that matches Custom Protection rules created on or after the specified date-time.
TimeCreatedLessThan string
A filter that matches custom protection rules created before the specified date-time.
CompartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
DisplayNames []string
Filter custom protection rules using a list of display names.
Filters Changes to this property will trigger replacement. []GetCustomProtectionRulesFilter
Ids []string
Filter custom protection rules using a list of custom protection rule OCIDs.
States []string
Filter Custom Protection rules using a list of lifecycle states.
TimeCreatedGreaterThanOrEqualTo string
A filter that matches Custom Protection rules created on or after the specified date-time.
TimeCreatedLessThan string
A filter that matches custom protection rules created before the specified date-time.
compartmentId This property is required. String
The OCID of the compartment. This number is generated when the compartment is created.
displayNames List<String>
Filter custom protection rules using a list of display names.
filters Changes to this property will trigger replacement. List<GetCustomProtectionRulesFilter>
ids List<String>
Filter custom protection rules using a list of custom protection rule OCIDs.
states List<String>
Filter Custom Protection rules using a list of lifecycle states.
timeCreatedGreaterThanOrEqualTo String
A filter that matches Custom Protection rules created on or after the specified date-time.
timeCreatedLessThan String
A filter that matches custom protection rules created before the specified date-time.
compartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
displayNames string[]
Filter custom protection rules using a list of display names.
filters Changes to this property will trigger replacement. GetCustomProtectionRulesFilter[]
ids string[]
Filter custom protection rules using a list of custom protection rule OCIDs.
states string[]
Filter Custom Protection rules using a list of lifecycle states.
timeCreatedGreaterThanOrEqualTo string
A filter that matches Custom Protection rules created on or after the specified date-time.
timeCreatedLessThan string
A filter that matches custom protection rules created before the specified date-time.
compartment_id This property is required. str
The OCID of the compartment. This number is generated when the compartment is created.
display_names Sequence[str]
Filter custom protection rules using a list of display names.
filters Changes to this property will trigger replacement. Sequence[waas.GetCustomProtectionRulesFilter]
ids Sequence[str]
Filter custom protection rules using a list of custom protection rule OCIDs.
states Sequence[str]
Filter Custom Protection rules using a list of lifecycle states.
time_created_greater_than_or_equal_to str
A filter that matches Custom Protection rules created on or after the specified date-time.
time_created_less_than str
A filter that matches custom protection rules created before the specified date-time.
compartmentId This property is required. String
The OCID of the compartment. This number is generated when the compartment is created.
displayNames List<String>
Filter custom protection rules using a list of display names.
filters Changes to this property will trigger replacement. List<Property Map>
ids List<String>
Filter custom protection rules using a list of custom protection rule OCIDs.
states List<String>
Filter Custom Protection rules using a list of lifecycle states.
timeCreatedGreaterThanOrEqualTo String
A filter that matches Custom Protection rules created on or after the specified date-time.
timeCreatedLessThan String
A filter that matches custom protection rules created before the specified date-time.

getCustomProtectionRules Result

The following output properties are available:

CompartmentId string
The OCID of the custom protection rule's compartment.
CustomProtectionRules List<GetCustomProtectionRulesCustomProtectionRule>
The list of custom_protection_rules.
Id string
The provider-assigned unique ID for this managed resource.
DisplayNames List<string>
Filters List<GetCustomProtectionRulesFilter>
Ids List<string>
States List<string>
TimeCreatedGreaterThanOrEqualTo string
TimeCreatedLessThan string
CompartmentId string
The OCID of the custom protection rule's compartment.
CustomProtectionRules []GetCustomProtectionRulesCustomProtectionRule
The list of custom_protection_rules.
Id string
The provider-assigned unique ID for this managed resource.
DisplayNames []string
Filters []GetCustomProtectionRulesFilter
Ids []string
States []string
TimeCreatedGreaterThanOrEqualTo string
TimeCreatedLessThan string
compartmentId String
The OCID of the custom protection rule's compartment.
customProtectionRules List<GetCustomProtectionRulesCustomProtectionRule>
The list of custom_protection_rules.
id String
The provider-assigned unique ID for this managed resource.
displayNames List<String>
filters List<GetCustomProtectionRulesFilter>
ids List<String>
states List<String>
timeCreatedGreaterThanOrEqualTo String
timeCreatedLessThan String
compartmentId string
The OCID of the custom protection rule's compartment.
customProtectionRules GetCustomProtectionRulesCustomProtectionRule[]
The list of custom_protection_rules.
id string
The provider-assigned unique ID for this managed resource.
displayNames string[]
filters GetCustomProtectionRulesFilter[]
ids string[]
states string[]
timeCreatedGreaterThanOrEqualTo string
timeCreatedLessThan string
compartment_id str
The OCID of the custom protection rule's compartment.
custom_protection_rules Sequence[waas.GetCustomProtectionRulesCustomProtectionRule]
The list of custom_protection_rules.
id str
The provider-assigned unique ID for this managed resource.
display_names Sequence[str]
filters Sequence[waas.GetCustomProtectionRulesFilter]
ids Sequence[str]
states Sequence[str]
time_created_greater_than_or_equal_to str
time_created_less_than str
compartmentId String
The OCID of the custom protection rule's compartment.
customProtectionRules List<Property Map>
The list of custom_protection_rules.
id String
The provider-assigned unique ID for this managed resource.
displayNames List<String>
filters List<Property Map>
ids List<String>
states List<String>
timeCreatedGreaterThanOrEqualTo String
timeCreatedLessThan String

Supporting Types

GetCustomProtectionRulesCustomProtectionRule

CompartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
DefinedTags This property is required. Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
Description This property is required. string
The description of the custom protection rule.
DisplayName This property is required. string
The user-friendly name of the custom protection rule.
FreeformTags This property is required. Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the custom protection rule.
ModSecurityRuleIds This property is required. List<string>
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
State This property is required. string
The current lifecycle state of the custom protection rule.
Template This property is required. string
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
TimeCreated This property is required. string
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
CompartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
DefinedTags This property is required. map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
Description This property is required. string
The description of the custom protection rule.
DisplayName This property is required. string
The user-friendly name of the custom protection rule.
FreeformTags This property is required. map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the custom protection rule.
ModSecurityRuleIds This property is required. []string
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
State This property is required. string
The current lifecycle state of the custom protection rule.
Template This property is required. string
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
TimeCreated This property is required. string
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
compartmentId This property is required. String
The OCID of the compartment. This number is generated when the compartment is created.
definedTags This property is required. Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. String
The description of the custom protection rule.
displayName This property is required. String
The user-friendly name of the custom protection rule.
freeformTags This property is required. Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the custom protection rule.
modSecurityRuleIds This property is required. List<String>
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
state This property is required. String
The current lifecycle state of the custom protection rule.
template This property is required. String
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
timeCreated This property is required. String
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
compartmentId This property is required. string
The OCID of the compartment. This number is generated when the compartment is created.
definedTags This property is required. {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. string
The description of the custom protection rule.
displayName This property is required. string
The user-friendly name of the custom protection rule.
freeformTags This property is required. {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. string
The OCID of the custom protection rule.
modSecurityRuleIds This property is required. string[]
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
state This property is required. string
The current lifecycle state of the custom protection rule.
template This property is required. string
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
timeCreated This property is required. string
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
compartment_id This property is required. str
The OCID of the compartment. This number is generated when the compartment is created.
defined_tags This property is required. Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. str
The description of the custom protection rule.
display_name This property is required. str
The user-friendly name of the custom protection rule.
freeform_tags This property is required. Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. str
The OCID of the custom protection rule.
mod_security_rule_ids This property is required. Sequence[str]
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
state This property is required. str
The current lifecycle state of the custom protection rule.
template This property is required. str
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
time_created This property is required. str
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
compartmentId This property is required. String
The OCID of the compartment. This number is generated when the compartment is created.
definedTags This property is required. Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. String
The description of the custom protection rule.
displayName This property is required. String
The user-friendly name of the custom protection rule.
freeformTags This property is required. Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the custom protection rule.
modSecurityRuleIds This property is required. List<String>
The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
state This property is required. String
The current lifecycle state of the custom protection rule.
template This property is required. String
The template text of the custom protection rule. All custom protection rules are expressed in ModSecurity Rule Language.
timeCreated This property is required. String
The date and time the protection rule was created, expressed in RFC 3339 timestamp format.

GetCustomProtectionRulesFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi