1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Events
  5. Rule
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Events.Rule

Explore with Pulumi AI

This resource provides the Rule resource in Oracle Cloud Infrastructure Events service.

Creates a new rule.

Example Usage

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

const testRule = new oci.events.Rule("test_rule", {
    actions: {
        actions: [{
            actionType: ruleActionsActionsActionType,
            isEnabled: ruleActionsActionsIsEnabled,
            description: ruleActionsActionsDescription,
            functionId: testFunction.id,
            streamId: testStream.id,
            topicId: testTopic.id,
        }],
    },
    compartmentId: compartmentId,
    condition: ruleCondition,
    displayName: ruleDisplayName,
    isEnabled: ruleIsEnabled,
    definedTags: {
        "Operations.CostCenter": "42",
    },
    description: ruleDescription,
    freeformTags: {
        Department: "Finance",
    },
});
Copy
import pulumi
import pulumi_oci as oci

test_rule = oci.events.Rule("test_rule",
    actions={
        "actions": [{
            "action_type": rule_actions_actions_action_type,
            "is_enabled": rule_actions_actions_is_enabled,
            "description": rule_actions_actions_description,
            "function_id": test_function["id"],
            "stream_id": test_stream["id"],
            "topic_id": test_topic["id"],
        }],
    },
    compartment_id=compartment_id,
    condition=rule_condition,
    display_name=rule_display_name,
    is_enabled=rule_is_enabled,
    defined_tags={
        "Operations.CostCenter": "42",
    },
    description=rule_description,
    freeform_tags={
        "Department": "Finance",
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := events.NewRule(ctx, "test_rule", &events.RuleArgs{
			Actions: &events.RuleActionsArgs{
				Actions: events.RuleActionsActionArray{
					&events.RuleActionsActionArgs{
						ActionType:  pulumi.Any(ruleActionsActionsActionType),
						IsEnabled:   pulumi.Any(ruleActionsActionsIsEnabled),
						Description: pulumi.Any(ruleActionsActionsDescription),
						FunctionId:  pulumi.Any(testFunction.Id),
						StreamId:    pulumi.Any(testStream.Id),
						TopicId:     pulumi.Any(testTopic.Id),
					},
				},
			},
			CompartmentId: pulumi.Any(compartmentId),
			Condition:     pulumi.Any(ruleCondition),
			DisplayName:   pulumi.Any(ruleDisplayName),
			IsEnabled:     pulumi.Any(ruleIsEnabled),
			DefinedTags: pulumi.StringMap{
				"Operations.CostCenter": pulumi.String("42"),
			},
			Description: pulumi.Any(ruleDescription),
			FreeformTags: pulumi.StringMap{
				"Department": pulumi.String("Finance"),
			},
		})
		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 testRule = new Oci.Events.Rule("test_rule", new()
    {
        Actions = new Oci.Events.Inputs.RuleActionsArgs
        {
            Actions = new[]
            {
                new Oci.Events.Inputs.RuleActionsActionArgs
                {
                    ActionType = ruleActionsActionsActionType,
                    IsEnabled = ruleActionsActionsIsEnabled,
                    Description = ruleActionsActionsDescription,
                    FunctionId = testFunction.Id,
                    StreamId = testStream.Id,
                    TopicId = testTopic.Id,
                },
            },
        },
        CompartmentId = compartmentId,
        Condition = ruleCondition,
        DisplayName = ruleDisplayName,
        IsEnabled = ruleIsEnabled,
        DefinedTags = 
        {
            { "Operations.CostCenter", "42" },
        },
        Description = ruleDescription,
        FreeformTags = 
        {
            { "Department", "Finance" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Events.Rule;
import com.pulumi.oci.Events.RuleArgs;
import com.pulumi.oci.Events.inputs.RuleActionsArgs;
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 testRule = new Rule("testRule", RuleArgs.builder()
            .actions(RuleActionsArgs.builder()
                .actions(RuleActionsActionArgs.builder()
                    .actionType(ruleActionsActionsActionType)
                    .isEnabled(ruleActionsActionsIsEnabled)
                    .description(ruleActionsActionsDescription)
                    .functionId(testFunction.id())
                    .streamId(testStream.id())
                    .topicId(testTopic.id())
                    .build())
                .build())
            .compartmentId(compartmentId)
            .condition(ruleCondition)
            .displayName(ruleDisplayName)
            .isEnabled(ruleIsEnabled)
            .definedTags(Map.of("Operations.CostCenter", "42"))
            .description(ruleDescription)
            .freeformTags(Map.of("Department", "Finance"))
            .build());

    }
}
Copy
resources:
  testRule:
    type: oci:Events:Rule
    name: test_rule
    properties:
      actions:
        actions:
          - actionType: ${ruleActionsActionsActionType}
            isEnabled: ${ruleActionsActionsIsEnabled}
            description: ${ruleActionsActionsDescription}
            functionId: ${testFunction.id}
            streamId: ${testStream.id}
            topicId: ${testTopic.id}
      compartmentId: ${compartmentId}
      condition: ${ruleCondition}
      displayName: ${ruleDisplayName}
      isEnabled: ${ruleIsEnabled}
      definedTags:
        Operations.CostCenter: '42'
      description: ${ruleDescription}
      freeformTags:
        Department: Finance
Copy

Create Rule Resource

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

Constructor syntax

new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);
@overload
def Rule(resource_name: str,
         args: RuleArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def Rule(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         actions: Optional[_events.RuleActionsArgs] = None,
         compartment_id: Optional[str] = None,
         condition: Optional[str] = None,
         display_name: Optional[str] = None,
         is_enabled: Optional[bool] = None,
         defined_tags: Optional[Mapping[str, str]] = None,
         description: Optional[str] = None,
         freeform_tags: Optional[Mapping[str, str]] = None)
func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
public Rule(String name, RuleArgs args)
public Rule(String name, RuleArgs args, CustomResourceOptions options)
type: oci:Events:Rule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RuleArgs
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 ociRuleResource = new Oci.Events.Rule("ociRuleResource", new()
{
    Actions = new Oci.Events.Inputs.RuleActionsArgs
    {
        Actions = new[]
        {
            new Oci.Events.Inputs.RuleActionsActionArgs
            {
                ActionType = "string",
                IsEnabled = false,
                Description = "string",
                FunctionId = "string",
                Id = "string",
                LifecycleMessage = "string",
                State = "string",
                StreamId = "string",
                TopicId = "string",
            },
        },
    },
    CompartmentId = "string",
    Condition = "string",
    DisplayName = "string",
    IsEnabled = false,
    DefinedTags = 
    {
        { "string", "string" },
    },
    Description = "string",
    FreeformTags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := Events.NewRule(ctx, "ociRuleResource", &Events.RuleArgs{
	Actions: &events.RuleActionsArgs{
		Actions: events.RuleActionsActionArray{
			&events.RuleActionsActionArgs{
				ActionType:       pulumi.String("string"),
				IsEnabled:        pulumi.Bool(false),
				Description:      pulumi.String("string"),
				FunctionId:       pulumi.String("string"),
				Id:               pulumi.String("string"),
				LifecycleMessage: pulumi.String("string"),
				State:            pulumi.String("string"),
				StreamId:         pulumi.String("string"),
				TopicId:          pulumi.String("string"),
			},
		},
	},
	CompartmentId: pulumi.String("string"),
	Condition:     pulumi.String("string"),
	DisplayName:   pulumi.String("string"),
	IsEnabled:     pulumi.Bool(false),
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var ociRuleResource = new Rule("ociRuleResource", RuleArgs.builder()
    .actions(RuleActionsArgs.builder()
        .actions(RuleActionsActionArgs.builder()
            .actionType("string")
            .isEnabled(false)
            .description("string")
            .functionId("string")
            .id("string")
            .lifecycleMessage("string")
            .state("string")
            .streamId("string")
            .topicId("string")
            .build())
        .build())
    .compartmentId("string")
    .condition("string")
    .displayName("string")
    .isEnabled(false)
    .definedTags(Map.of("string", "string"))
    .description("string")
    .freeformTags(Map.of("string", "string"))
    .build());
Copy
oci_rule_resource = oci.events.Rule("ociRuleResource",
    actions={
        "actions": [{
            "action_type": "string",
            "is_enabled": False,
            "description": "string",
            "function_id": "string",
            "id": "string",
            "lifecycle_message": "string",
            "state": "string",
            "stream_id": "string",
            "topic_id": "string",
        }],
    },
    compartment_id="string",
    condition="string",
    display_name="string",
    is_enabled=False,
    defined_tags={
        "string": "string",
    },
    description="string",
    freeform_tags={
        "string": "string",
    })
Copy
const ociRuleResource = new oci.events.Rule("ociRuleResource", {
    actions: {
        actions: [{
            actionType: "string",
            isEnabled: false,
            description: "string",
            functionId: "string",
            id: "string",
            lifecycleMessage: "string",
            state: "string",
            streamId: "string",
            topicId: "string",
        }],
    },
    compartmentId: "string",
    condition: "string",
    displayName: "string",
    isEnabled: false,
    definedTags: {
        string: "string",
    },
    description: "string",
    freeformTags: {
        string: "string",
    },
});
Copy
type: oci:Events:Rule
properties:
    actions:
        actions:
            - actionType: string
              description: string
              functionId: string
              id: string
              isEnabled: false
              lifecycleMessage: string
              state: string
              streamId: string
              topicId: string
    compartmentId: string
    condition: string
    definedTags:
        string: string
    description: string
    displayName: string
    freeformTags:
        string: string
    isEnabled: false
Copy

Rule 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 Rule resource accepts the following input properties:

Actions This property is required. RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
CompartmentId This property is required. string
(Updatable) The OCID of the compartment to which this rule belongs.
Condition This property is required. string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

DisplayName This property is required. string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
IsEnabled This property is required. bool

(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

DefinedTags Dictionary<string, string>
(Updatable) 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 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.
FreeformTags Dictionary<string, string>
(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. Example: {"Department": "Finance"}
Actions This property is required. RuleActionsArgs
(Updatable) A list of ActionDetails objects to create for a rule.
CompartmentId This property is required. string
(Updatable) The OCID of the compartment to which this rule belongs.
Condition This property is required. string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

DisplayName This property is required. string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
IsEnabled This property is required. bool

(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

DefinedTags map[string]string
(Updatable) 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 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.
FreeformTags map[string]string
(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. Example: {"Department": "Finance"}
actions This property is required. RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId This property is required. String
(Updatable) The OCID of the compartment to which this rule belongs.
condition This property is required. String

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

displayName This property is required. String
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
isEnabled This property is required. Boolean

(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

definedTags Map<String,String>
(Updatable) 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 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.
freeformTags Map<String,String>
(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. Example: {"Department": "Finance"}
actions This property is required. RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId This property is required. string
(Updatable) The OCID of the compartment to which this rule belongs.
condition This property is required. string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

displayName This property is required. string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
isEnabled This property is required. boolean

(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

definedTags {[key: string]: string}
(Updatable) 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 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.
freeformTags {[key: string]: string}
(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. Example: {"Department": "Finance"}
actions This property is required. events.RuleActionsArgs
(Updatable) A list of ActionDetails objects to create for a rule.
compartment_id This property is required. str
(Updatable) The OCID of the compartment to which this rule belongs.
condition This property is required. str

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

display_name This property is required. str
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
is_enabled This property is required. bool

(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

defined_tags Mapping[str, str]
(Updatable) 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 str
(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.
freeform_tags Mapping[str, str]
(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. Example: {"Department": "Finance"}
actions This property is required. Property Map
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId This property is required. String
(Updatable) The OCID of the compartment to which this rule belongs.
condition This property is required. String

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

displayName This property is required. String
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
isEnabled This property is required. Boolean

(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

definedTags Map<String>
(Updatable) 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 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.
freeformTags Map<String>
(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. Example: {"Department": "Finance"}

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
TimeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
Id string
The provider-assigned unique ID for this managed resource.
LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
TimeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
id String
The provider-assigned unique ID for this managed resource.
lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
timeCreated String
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
id string
The provider-assigned unique ID for this managed resource.
lifecycleMessage string
A message generated by the Events service about the current state of this rule.
state string
The current state of the rule.
timeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
id str
The provider-assigned unique ID for this managed resource.
lifecycle_message str
A message generated by the Events service about the current state of this rule.
state str
The current state of the rule.
time_created str
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
id String
The provider-assigned unique ID for this managed resource.
lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
timeCreated String
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z

Look up Existing Rule Resource

Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[_events.RuleActionsArgs] = None,
        compartment_id: Optional[str] = None,
        condition: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        is_enabled: Optional[bool] = None,
        lifecycle_message: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None) -> Rule
func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)
resources:  _:    type: oci:Events:Rule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Actions RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
CompartmentId string
(Updatable) The OCID of the compartment to which this rule belongs.
Condition string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

DefinedTags Dictionary<string, string>
(Updatable) 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 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.
DisplayName string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
(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. Example: {"Department": "Finance"}
IsEnabled bool

(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

LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
TimeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
Actions RuleActionsArgs
(Updatable) A list of ActionDetails objects to create for a rule.
CompartmentId string
(Updatable) The OCID of the compartment to which this rule belongs.
Condition string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

DefinedTags map[string]string
(Updatable) 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 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.
DisplayName string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
FreeformTags map[string]string
(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. Example: {"Department": "Finance"}
IsEnabled bool

(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

LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
TimeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
actions RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId String
(Updatable) The OCID of the compartment to which this rule belongs.
condition String

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

definedTags Map<String,String>
(Updatable) 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 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.
displayName String
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
freeformTags Map<String,String>
(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. Example: {"Department": "Finance"}
isEnabled Boolean

(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

lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
timeCreated String
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
actions RuleActions
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId string
(Updatable) The OCID of the compartment to which this rule belongs.
condition string

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

definedTags {[key: string]: string}
(Updatable) 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 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.
displayName string
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
freeformTags {[key: string]: string}
(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. Example: {"Department": "Finance"}
isEnabled boolean

(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

lifecycleMessage string
A message generated by the Events service about the current state of this rule.
state string
The current state of the rule.
timeCreated string
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
actions events.RuleActionsArgs
(Updatable) A list of ActionDetails objects to create for a rule.
compartment_id str
(Updatable) The OCID of the compartment to which this rule belongs.
condition str

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

defined_tags Mapping[str, str]
(Updatable) 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 str
(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.
display_name str
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
freeform_tags Mapping[str, str]
(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. Example: {"Department": "Finance"}
is_enabled bool

(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

lifecycle_message str
A message generated by the Events service about the current state of this rule.
state str
The current state of the rule.
time_created str
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z
actions Property Map
(Updatable) A list of ActionDetails objects to create for a rule.
compartmentId String
(Updatable) The OCID of the compartment to which this rule belongs.
condition String

(Updatable) A filter that specifies the event that will trigger actions associated with this rule. 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.

  • 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.

  • 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

Example: \"eventType\": \"com.oraclecloud.databaseservice.autonomous.database.backup.end\"

definedTags Map<String>
(Updatable) 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 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.
displayName String
(Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
freeformTags Map<String>
(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. Example: {"Department": "Finance"}
isEnabled Boolean

(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

lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
timeCreated String
The time this rule was created, expressed in RFC 3339 timestamp format. Example: 2018-09-12T22:47:12.613Z

Supporting Types

RuleActions
, RuleActionsArgs

Actions This property is required. List<RuleActionsAction>
(Updatable) A list of one or more ActionDetails objects.
Actions This property is required. []RuleActionsAction
(Updatable) A list of one or more ActionDetails objects.
actions This property is required. List<RuleActionsAction>
(Updatable) A list of one or more ActionDetails objects.
actions This property is required. RuleActionsAction[]
(Updatable) A list of one or more ActionDetails objects.
actions This property is required. Sequence[events.RuleActionsAction]
(Updatable) A list of one or more ActionDetails objects.
actions This property is required. List<Property Map>
(Updatable) A list of one or more ActionDetails objects.

RuleActionsAction
, RuleActionsActionArgs

ActionType This property is required. string
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
IsEnabled This property is required. bool
(Updatable) Whether or not this action is currently enabled. Example: true
Description string
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
FunctionId string
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
Id string
The OCID of this rule.
LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
StreamId string
(Updatable) The OCID of the stream to which messages are delivered.
TopicId string
(Updatable) The OCID of the topic to which messages are delivered.
ActionType This property is required. string
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
IsEnabled This property is required. bool
(Updatable) Whether or not this action is currently enabled. Example: true
Description string
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
FunctionId string
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
Id string
The OCID of this rule.
LifecycleMessage string
A message generated by the Events service about the current state of this rule.
State string
The current state of the rule.
StreamId string
(Updatable) The OCID of the stream to which messages are delivered.
TopicId string
(Updatable) The OCID of the topic to which messages are delivered.
actionType This property is required. String
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
isEnabled This property is required. Boolean
(Updatable) Whether or not this action is currently enabled. Example: true
description String
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
functionId String
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
id String
The OCID of this rule.
lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
streamId String
(Updatable) The OCID of the stream to which messages are delivered.
topicId String
(Updatable) The OCID of the topic to which messages are delivered.
actionType This property is required. string
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
isEnabled This property is required. boolean
(Updatable) Whether or not this action is currently enabled. Example: true
description string
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
functionId string
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
id string
The OCID of this rule.
lifecycleMessage string
A message generated by the Events service about the current state of this rule.
state string
The current state of the rule.
streamId string
(Updatable) The OCID of the stream to which messages are delivered.
topicId string
(Updatable) The OCID of the topic to which messages are delivered.
action_type This property is required. str
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
is_enabled This property is required. bool
(Updatable) Whether or not this action is currently enabled. Example: true
description str
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
function_id str
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
id str
The OCID of this rule.
lifecycle_message str
A message generated by the Events service about the current state of this rule.
state str
The current state of the rule.
stream_id str
(Updatable) The OCID of the stream to which messages are delivered.
topic_id str
(Updatable) The OCID of the topic to which messages are delivered.
actionType This property is required. String
(Updatable) The action to perform if the condition in the rule matches an event.

  • ONS: Send to an Oracle Notification Service topic.
  • OSS: Send to a stream from Oracle Streaming Service.
  • FAAS: Send to an Oracle Functions Service endpoint.
isEnabled This property is required. Boolean
(Updatable) Whether or not this action is currently enabled. Example: true
description String
(Updatable) A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering confidential information.
functionId String
(Updatable) The OCID of a Function hosted by Oracle Functions Service.
id String
The OCID of this rule.
lifecycleMessage String
A message generated by the Events service about the current state of this rule.
state String
The current state of the rule.
streamId String
(Updatable) The OCID of the stream to which messages are delivered.
topicId String
(Updatable) The OCID of the topic to which messages are delivered.

Import

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

$ pulumi import oci:Events/rule:Rule test_rule "id"
Copy

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.