Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.DataSafe.getAlertPolicyRule
Explore with Pulumi AI
This data source provides details about a specific Alert Policy Rule resource in Oracle Cloud Infrastructure Data Safe service.
Gets the details of a policy rule by its key.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testAlertPolicyRule = oci.DataSafe.getAlertPolicyRule({
    alertPolicyId: testAlertPolicy.id,
    ruleKey: alertPolicyRuleRuleKey,
});
import pulumi
import pulumi_oci as oci
test_alert_policy_rule = oci.DataSafe.get_alert_policy_rule(alert_policy_id=test_alert_policy["id"],
    rule_key=alert_policy_rule_rule_key)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/datasafe"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datasafe.GetAlertPolicyRule(ctx, &datasafe.GetAlertPolicyRuleArgs{
			AlertPolicyId: testAlertPolicy.Id,
			RuleKey:       alertPolicyRuleRuleKey,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testAlertPolicyRule = Oci.DataSafe.GetAlertPolicyRule.Invoke(new()
    {
        AlertPolicyId = testAlertPolicy.Id,
        RuleKey = alertPolicyRuleRuleKey,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DataSafe.DataSafeFunctions;
import com.pulumi.oci.DataSafe.inputs.GetAlertPolicyRuleArgs;
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 testAlertPolicyRule = DataSafeFunctions.getAlertPolicyRule(GetAlertPolicyRuleArgs.builder()
            .alertPolicyId(testAlertPolicy.id())
            .ruleKey(alertPolicyRuleRuleKey)
            .build());
    }
}
variables:
  testAlertPolicyRule:
    fn::invoke:
      function: oci:DataSafe:getAlertPolicyRule
      arguments:
        alertPolicyId: ${testAlertPolicy.id}
        ruleKey: ${alertPolicyRuleRuleKey}
Using getAlertPolicyRule
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 getAlertPolicyRule(args: GetAlertPolicyRuleArgs, opts?: InvokeOptions): Promise<GetAlertPolicyRuleResult>
function getAlertPolicyRuleOutput(args: GetAlertPolicyRuleOutputArgs, opts?: InvokeOptions): Output<GetAlertPolicyRuleResult>def get_alert_policy_rule(alert_policy_id: Optional[str] = None,
                          rule_key: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAlertPolicyRuleResult
def get_alert_policy_rule_output(alert_policy_id: Optional[pulumi.Input[str]] = None,
                          rule_key: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAlertPolicyRuleResult]func LookupAlertPolicyRule(ctx *Context, args *LookupAlertPolicyRuleArgs, opts ...InvokeOption) (*LookupAlertPolicyRuleResult, error)
func LookupAlertPolicyRuleOutput(ctx *Context, args *LookupAlertPolicyRuleOutputArgs, opts ...InvokeOption) LookupAlertPolicyRuleResultOutput> Note: This function is named LookupAlertPolicyRule in the Go SDK.
public static class GetAlertPolicyRule 
{
    public static Task<GetAlertPolicyRuleResult> InvokeAsync(GetAlertPolicyRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetAlertPolicyRuleResult> Invoke(GetAlertPolicyRuleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAlertPolicyRuleResult> getAlertPolicyRule(GetAlertPolicyRuleArgs args, InvokeOptions options)
public static Output<GetAlertPolicyRuleResult> getAlertPolicyRule(GetAlertPolicyRuleArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DataSafe/getAlertPolicyRule:getAlertPolicyRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AlertPolicy stringId 
- The OCID of the alert policy.
- RuleKey string
- The key of the alert policy rule.
- AlertPolicy stringId 
- The OCID of the alert policy.
- RuleKey string
- The key of the alert policy rule.
- alertPolicy StringId 
- The OCID of the alert policy.
- ruleKey String
- The key of the alert policy rule.
- alertPolicy stringId 
- The OCID of the alert policy.
- ruleKey string
- The key of the alert policy rule.
- alert_policy_ strid 
- The OCID of the alert policy.
- rule_key str
- The key of the alert policy rule.
- alertPolicy StringId 
- The OCID of the alert policy.
- ruleKey String
- The key of the alert policy rule.
getAlertPolicyRule Result
The following output properties are available:
- AlertPolicy stringId 
- Description string
- Describes the alert policy rule.
- DisplayName string
- The display name of the alert policy rule.
- Expression string
- The conditional expression of the alert policy rule which evaluates to boolean value.
- Id string
- Key string
- The unique key of the alert policy rule.
- RuleKey string
- State string
- The current state of the alert policy rule.
- TimeCreated string
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
- AlertPolicy stringId 
- Description string
- Describes the alert policy rule.
- DisplayName string
- The display name of the alert policy rule.
- Expression string
- The conditional expression of the alert policy rule which evaluates to boolean value.
- Id string
- Key string
- The unique key of the alert policy rule.
- RuleKey string
- State string
- The current state of the alert policy rule.
- TimeCreated string
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
- alertPolicy StringId 
- description String
- Describes the alert policy rule.
- displayName String
- The display name of the alert policy rule.
- expression String
- The conditional expression of the alert policy rule which evaluates to boolean value.
- id String
- key String
- The unique key of the alert policy rule.
- ruleKey String
- state String
- The current state of the alert policy rule.
- timeCreated String
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
- alertPolicy stringId 
- description string
- Describes the alert policy rule.
- displayName string
- The display name of the alert policy rule.
- expression string
- The conditional expression of the alert policy rule which evaluates to boolean value.
- id string
- key string
- The unique key of the alert policy rule.
- ruleKey string
- state string
- The current state of the alert policy rule.
- timeCreated string
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
- alert_policy_ strid 
- description str
- Describes the alert policy rule.
- display_name str
- The display name of the alert policy rule.
- expression str
- The conditional expression of the alert policy rule which evaluates to boolean value.
- id str
- key str
- The unique key of the alert policy rule.
- rule_key str
- state str
- The current state of the alert policy rule.
- time_created str
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
- alertPolicy StringId 
- description String
- Describes the alert policy rule.
- displayName String
- The display name of the alert policy rule.
- expression String
- The conditional expression of the alert policy rule which evaluates to boolean value.
- id String
- key String
- The unique key of the alert policy rule.
- ruleKey String
- state String
- The current state of the alert policy rule.
- timeCreated String
- Creation date and time of the alert policy rule, in the format defined by RFC3339.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.