import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * This resource provides the Rule resource in Oracle Cloud Infrastructure Events service. * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/events/latest/Rule * * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/events * * Creates a new rule. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testRule = new oci.events.Rule("test_rule", { * actions: { * actions: [{ * actionType: ruleActionsActionActionType, * isEnabled: ruleActionsActionIsEnabled === "true", * description: ruleActionsActionDescription, * functionId: testFunction.id, * streamId: testStream.id, * topicId: testTopic.id, * }], * }, * compartmentId: compartmentId, * conditionDetails: { * eventTypes: [ * "com.oraclecloud.objectstorage.createbucket", * "com.oraclecloud.objectstorage.deletebucket", * ], * data: JSON.stringify({}), * }, * displayName: ruleDisplayName, * isEnabled: ruleIsEnabled === "true", * definedTags: { * "Operations.CostCenter": "42", * }, * description: ruleDescription, * freeformTags: { * Department: "Finance", * }, * }); * ``` * * ## Import * * Rules can be imported using the `id`, e.g. * * ```sh * $ pulumi import oci:Events/rule:Rule test_rule "id" * ``` */ export declare class Rule extends pulumi.CustomResource { /** * Get an existing Rule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: RuleState, opts?: pulumi.CustomResourceOptions): Rule; /** * Returns true if the given object is an instance of Rule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Rule; /** * (Updatable) A list of ActionDetails objects to create for a rule. */ readonly actions: pulumi.Output; /** * (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this rule belongs. */ readonly compartmentId: pulumi.Output; /** * (Updatable) A JSON string filter that specifies the event that will trigger actions associated with this rule. Use either `condition` or `conditionDetails`. This argument is retained for backward compatibility. For new configurations, `conditionDetails` is recommended because it avoids manually escaping JSON and is easier to maintain when matching multiple event types. A few important things to remember about filters: * * Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets: `{}` * * For more examples, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm). * * For a condition with fields to match an event, the event must contain all the field names listed in the condition. Field names must appear in the condition with the same nesting structure used in the event. * * For a list of reference events, see [Services that Produce Events](https://docs.cloud.oracle.com/iaas/Content/Events/Reference/eventsproducers.htm). * * Rules apply to events in the compartment in which you create them and any child compartments. This means that a condition specified by a rule only matches events emitted from resources in the compartment or any of its child compartments. * * Wildcard matching is supported with the asterisk (*) character. * * For examples of wildcard matching, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm) * * Example: */ readonly condition: pulumi.Output; /** * (Updatable) A structured helper for building the rule condition JSON. Use either `condition` or `conditionDetails`. This is the recommended form for new configurations. */ readonly conditionDetails: pulumi.Output; /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ readonly definedTags: pulumi.Output<{ [key: string]: string; }>; /** * (Updatable) A string that describes the details of the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ readonly description: pulumi.Output; /** * (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ readonly displayName: pulumi.Output; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ readonly freeformTags: pulumi.Output<{ [key: string]: string; }>; /** * (Updatable) Whether or not this rule is currently enabled. Example: `true` * * ** 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 */ readonly isEnabled: pulumi.Output; /** * A message generated by the Events service about the current state of this rule. */ readonly lifecycleMessage: pulumi.Output; /** * The current state of the rule. */ readonly state: pulumi.Output; /** * The time this rule was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` */ readonly timeCreated: pulumi.Output; /** * Create a Rule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Rule resources. */ export interface RuleState { /** * (Updatable) A list of ActionDetails objects to create for a rule. */ actions?: pulumi.Input; /** * (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this rule belongs. */ compartmentId?: pulumi.Input; /** * (Updatable) A JSON string filter that specifies the event that will trigger actions associated with this rule. Use either `condition` or `conditionDetails`. This argument is retained for backward compatibility. For new configurations, `conditionDetails` is recommended because it avoids manually escaping JSON and is easier to maintain when matching multiple event types. A few important things to remember about filters: * * Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets: `{}` * * For more examples, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm). * * For a condition with fields to match an event, the event must contain all the field names listed in the condition. Field names must appear in the condition with the same nesting structure used in the event. * * For a list of reference events, see [Services that Produce Events](https://docs.cloud.oracle.com/iaas/Content/Events/Reference/eventsproducers.htm). * * Rules apply to events in the compartment in which you create them and any child compartments. This means that a condition specified by a rule only matches events emitted from resources in the compartment or any of its child compartments. * * Wildcard matching is supported with the asterisk (*) character. * * For examples of wildcard matching, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm) * * Example: */ condition?: pulumi.Input; /** * (Updatable) A structured helper for building the rule condition JSON. Use either `condition` or `conditionDetails`. This is the recommended form for new configurations. */ conditionDetails?: pulumi.Input; /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ definedTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) A string that describes the details of the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ description?: pulumi.Input; /** * (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ displayName?: pulumi.Input; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ freeformTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) Whether or not this rule is currently enabled. Example: `true` * * ** 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 */ isEnabled?: pulumi.Input; /** * A message generated by the Events service about the current state of this rule. */ lifecycleMessage?: pulumi.Input; /** * The current state of the rule. */ state?: pulumi.Input; /** * The time this rule was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` */ timeCreated?: pulumi.Input; } /** * The set of arguments for constructing a Rule resource. */ export interface RuleArgs { /** * (Updatable) A list of ActionDetails objects to create for a rule. */ actions: pulumi.Input; /** * (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this rule belongs. */ compartmentId: pulumi.Input; /** * (Updatable) A JSON string filter that specifies the event that will trigger actions associated with this rule. Use either `condition` or `conditionDetails`. This argument is retained for backward compatibility. For new configurations, `conditionDetails` is recommended because it avoids manually escaping JSON and is easier to maintain when matching multiple event types. A few important things to remember about filters: * * Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets: `{}` * * For more examples, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm). * * For a condition with fields to match an event, the event must contain all the field names listed in the condition. Field names must appear in the condition with the same nesting structure used in the event. * * For a list of reference events, see [Services that Produce Events](https://docs.cloud.oracle.com/iaas/Content/Events/Reference/eventsproducers.htm). * * Rules apply to events in the compartment in which you create them and any child compartments. This means that a condition specified by a rule only matches events emitted from resources in the compartment or any of its child compartments. * * Wildcard matching is supported with the asterisk (*) character. * * For examples of wildcard matching, see [Matching Events with Filters](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/filterevents.htm) * * Example: */ condition?: pulumi.Input; /** * (Updatable) A structured helper for building the rule condition JSON. Use either `condition` or `conditionDetails`. This is the recommended form for new configurations. */ conditionDetails?: pulumi.Input; /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ definedTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) A string that describes the details of the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ description?: pulumi.Input; /** * (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information. */ displayName: pulumi.Input; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ freeformTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) Whether or not this rule is currently enabled. Example: `true` * * ** 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 */ isEnabled: pulumi.Input; } //# sourceMappingURL=rule.d.ts.map