1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DataSafe
  5. AlertPolicyRule
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.DataSafe.AlertPolicyRule

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource provides the Alert Policy Rule resource in Oracle Cloud Infrastructure Data Safe service.

    Creates a new rule for the alert policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testAlertPolicyRule = new oci.datasafe.AlertPolicyRule("test_alert_policy_rule", {
        alertPolicyId: testAlertPolicy.id,
        expression: alertPolicyRuleExpression,
        description: alertPolicyRuleDescription,
        displayName: alertPolicyRuleDisplayName,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_alert_policy_rule = oci.data_safe.AlertPolicyRule("test_alert_policy_rule",
        alert_policy_id=test_alert_policy["id"],
        expression=alert_policy_rule_expression,
        description=alert_policy_rule_description,
        display_name=alert_policy_rule_display_name)
    
    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.NewAlertPolicyRule(ctx, "test_alert_policy_rule", &DataSafe.AlertPolicyRuleArgs{
    			AlertPolicyId: pulumi.Any(testAlertPolicy.Id),
    			Expression:    pulumi.Any(alertPolicyRuleExpression),
    			Description:   pulumi.Any(alertPolicyRuleDescription),
    			DisplayName:   pulumi.Any(alertPolicyRuleDisplayName),
    		})
    		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 = new Oci.DataSafe.AlertPolicyRule("test_alert_policy_rule", new()
        {
            AlertPolicyId = testAlertPolicy.Id,
            Expression = alertPolicyRuleExpression,
            Description = alertPolicyRuleDescription,
            DisplayName = alertPolicyRuleDisplayName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DataSafe.AlertPolicyRule;
    import com.pulumi.oci.DataSafe.AlertPolicyRuleArgs;
    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) {
            var testAlertPolicyRule = new AlertPolicyRule("testAlertPolicyRule", AlertPolicyRuleArgs.builder()
                .alertPolicyId(testAlertPolicy.id())
                .expression(alertPolicyRuleExpression)
                .description(alertPolicyRuleDescription)
                .displayName(alertPolicyRuleDisplayName)
                .build());
    
        }
    }
    
    resources:
      testAlertPolicyRule:
        type: oci:DataSafe:AlertPolicyRule
        name: test_alert_policy_rule
        properties:
          alertPolicyId: ${testAlertPolicy.id}
          expression: ${alertPolicyRuleExpression}
          description: ${alertPolicyRuleDescription}
          displayName: ${alertPolicyRuleDisplayName}
    

    Create AlertPolicyRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AlertPolicyRule(name: string, args: AlertPolicyRuleArgs, opts?: CustomResourceOptions);
    @overload
    def AlertPolicyRule(resource_name: str,
                        args: AlertPolicyRuleArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertPolicyRule(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        alert_policy_id: Optional[str] = None,
                        expression: Optional[str] = None,
                        description: Optional[str] = None,
                        display_name: Optional[str] = None)
    func NewAlertPolicyRule(ctx *Context, name string, args AlertPolicyRuleArgs, opts ...ResourceOption) (*AlertPolicyRule, error)
    public AlertPolicyRule(string name, AlertPolicyRuleArgs args, CustomResourceOptions? opts = null)
    public AlertPolicyRule(String name, AlertPolicyRuleArgs args)
    public AlertPolicyRule(String name, AlertPolicyRuleArgs args, CustomResourceOptions options)
    
    type: oci:DataSafe:AlertPolicyRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AlertPolicyRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AlertPolicyRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AlertPolicyRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertPolicyRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertPolicyRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alertPolicyRuleResource = new Oci.DataSafe.AlertPolicyRule("alertPolicyRuleResource", new()
    {
        AlertPolicyId = "string",
        Expression = "string",
        Description = "string",
        DisplayName = "string",
    });
    
    example, err := DataSafe.NewAlertPolicyRule(ctx, "alertPolicyRuleResource", &DataSafe.AlertPolicyRuleArgs{
    	AlertPolicyId: pulumi.String("string"),
    	Expression:    pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	DisplayName:   pulumi.String("string"),
    })
    
    var alertPolicyRuleResource = new AlertPolicyRule("alertPolicyRuleResource", AlertPolicyRuleArgs.builder()
        .alertPolicyId("string")
        .expression("string")
        .description("string")
        .displayName("string")
        .build());
    
    alert_policy_rule_resource = oci.data_safe.AlertPolicyRule("alertPolicyRuleResource",
        alert_policy_id="string",
        expression="string",
        description="string",
        display_name="string")
    
    const alertPolicyRuleResource = new oci.datasafe.AlertPolicyRule("alertPolicyRuleResource", {
        alertPolicyId: "string",
        expression: "string",
        description: "string",
        displayName: "string",
    });
    
    type: oci:DataSafe:AlertPolicyRule
    properties:
        alertPolicyId: string
        description: string
        displayName: string
        expression: string
    

    AlertPolicyRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AlertPolicyRule resource accepts the following input properties:

    AlertPolicyId string
    The OCID of the alert policy.
    Expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Description string
    (Updatable) Describes the alert policy rule.
    DisplayName string
    (Updatable) The display name of the alert policy rule.
    AlertPolicyId string
    The OCID of the alert policy.
    Expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Description string
    (Updatable) Describes the alert policy rule.
    DisplayName string
    (Updatable) The display name of the alert policy rule.
    alertPolicyId String
    The OCID of the alert policy.
    expression String

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description String
    (Updatable) Describes the alert policy rule.
    displayName String
    (Updatable) The display name of the alert policy rule.
    alertPolicyId string
    The OCID of the alert policy.
    expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description string
    (Updatable) Describes the alert policy rule.
    displayName string
    (Updatable) The display name of the alert policy rule.
    alert_policy_id str
    The OCID of the alert policy.
    expression str

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description str
    (Updatable) Describes the alert policy rule.
    display_name str
    (Updatable) The display name of the alert policy rule.
    alertPolicyId String
    The OCID of the alert policy.
    expression String

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description String
    (Updatable) Describes the alert policy rule.
    displayName String
    (Updatable) The display name of the alert policy rule.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AlertPolicyRule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The unique key of the alert policy rule.
    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.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The unique key of the alert policy rule.
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The unique key of the alert policy rule.
    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.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The unique key of the alert policy rule.
    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.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    The unique key of the alert policy rule.
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The unique key of the alert policy rule.
    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.

    Look up Existing AlertPolicyRule Resource

    Get an existing AlertPolicyRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AlertPolicyRuleState, opts?: CustomResourceOptions): AlertPolicyRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alert_policy_id: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            expression: Optional[str] = None,
            key: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None) -> AlertPolicyRule
    func GetAlertPolicyRule(ctx *Context, name string, id IDInput, state *AlertPolicyRuleState, opts ...ResourceOption) (*AlertPolicyRule, error)
    public static AlertPolicyRule Get(string name, Input<string> id, AlertPolicyRuleState? state, CustomResourceOptions? opts = null)
    public static AlertPolicyRule get(String name, Output<String> id, AlertPolicyRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AlertPolicyId string
    The OCID of the alert policy.
    Description string
    (Updatable) Describes the alert policy rule.
    DisplayName string
    (Updatable) The display name of the alert policy rule.
    Expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Key string
    The unique key of the alert policy rule.
    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.
    AlertPolicyId string
    The OCID of the alert policy.
    Description string
    (Updatable) Describes the alert policy rule.
    DisplayName string
    (Updatable) The display name of the alert policy rule.
    Expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Key string
    The unique key of the alert policy rule.
    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.
    alertPolicyId String
    The OCID of the alert policy.
    description String
    (Updatable) Describes the alert policy rule.
    displayName String
    (Updatable) The display name of the alert policy rule.
    expression String

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    key String
    The unique key of the alert policy rule.
    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.
    alertPolicyId string
    The OCID of the alert policy.
    description string
    (Updatable) Describes the alert policy rule.
    displayName string
    (Updatable) The display name of the alert policy rule.
    expression string

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    key string
    The unique key of the alert policy rule.
    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_id str
    The OCID of the alert policy.
    description str
    (Updatable) Describes the alert policy rule.
    display_name str
    (Updatable) The display name of the alert policy rule.
    expression str

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    key str
    The unique key of the alert policy rule.
    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.
    alertPolicyId String
    The OCID of the alert policy.
    description String
    (Updatable) Describes the alert policy rule.
    displayName String
    (Updatable) The display name of the alert policy rule.
    expression String

    (Updatable) The conditional expression of the alert policy rule which evaluates to boolean value.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    key String
    The unique key of the alert policy rule.
    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.

    Import

    AlertPolicyRules can be imported using the id, e.g.

    $ pulumi import oci:DataSafe/alertPolicyRule:AlertPolicyRule test_alert_policy_rule "alertPolicies/{alertPolicyId}/rules/{ruleKey}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi