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",
},
});
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",
})
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
})
}
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" },
},
});
});
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());
}
}
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
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)
type: oci:Events:Rule
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 RuleArgs
- 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 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 string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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" },
},
});
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"),
},
})
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());
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",
})
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",
},
});
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
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
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- Compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- Display
Name string - (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 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
- 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.
- 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
Rule
Actions Args - (Updatable) A list of ActionDetails objects to create for a rule.
- Compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- Display
Name string - (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 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
- 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.
- 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
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- display
Name String - (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 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
- 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.
- 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
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- display
Name string - (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 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
- {[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.
- {[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
events.
Rule Actions Args - (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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- 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
- 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.
- 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 Property Map
- (Updatable) A list of ActionDetails objects to create for a rule.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- display
Name String - (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 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
- 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.
- 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.
- Lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Time
Created 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.
- Lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Time
Created 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.
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- time
Created 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.
- lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- state string
- The current state of the rule.
- time
Created 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.
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- time
Created 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)
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.
- Actions
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- Compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- Display
Name string - (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
- 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"}
- 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 string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Time
Created string - The time this rule was created, expressed in RFC 3339 timestamp format. Example:
2018-09-12T22:47:12.613Z
- Actions
Rule
Actions Args - (Updatable) A list of ActionDetails objects to create for a rule.
- Compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- Display
Name string - (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
- 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"}
- 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 string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Time
Created string - The time this rule was created, expressed in RFC 3339 timestamp format. Example:
2018-09-12T22:47:12.613Z
- actions
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- display
Name String - (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
- 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"}
- is
Enabled 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
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- time
Created String - The time this rule was created, expressed in RFC 3339 timestamp format. Example:
2018-09-12T22:47:12.613Z
- actions
Rule
Actions - (Updatable) A list of ActionDetails objects to create for a rule.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- {[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.
- display
Name string - (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
- {[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"}
- is
Enabled 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
- lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- state string
- The current state of the rule.
- time
Created string - The time this rule was created, expressed in RFC 3339 timestamp format. Example:
2018-09-12T22:47:12.613Z
- actions
events.
Rule Actions Args - (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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- 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.
- compartment
Id 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\"
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches all events with two curly brackets:
- 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.
- display
Name String - (Updatable) A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
- 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"}
- is
Enabled 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
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- time
Created 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
List<Rule
Actions Action> - (Updatable) A list of one or more ActionDetails objects.
- Actions
[]Rule
Actions Action - (Updatable) A list of one or more ActionDetails objects.
- actions
List<Rule
Actions Action> - (Updatable) A list of one or more ActionDetails objects.
- actions
Rule
Actions Action[] - (Updatable) A list of one or more ActionDetails objects.
- actions
Sequence[events.
Rule Actions Action] - (Updatable) A list of one or more ActionDetails objects.
- actions List<Property Map>
- (Updatable) A list of one or more ActionDetails objects.
RuleActionsAction, RuleActionsActionArgs
- Action
Type 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.
- Is
Enabled 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.
- Function
Id string - (Updatable) The OCID of a Function hosted by Oracle Functions Service.
- Id string
- The OCID of this rule.
- Lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Stream
Id string - (Updatable) The OCID of the stream to which messages are delivered.
- Topic
Id string - (Updatable) The OCID of the topic to which messages are delivered.
- Action
Type 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.
- Is
Enabled 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.
- Function
Id string - (Updatable) The OCID of a Function hosted by Oracle Functions Service.
- Id string
- The OCID of this rule.
- Lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- State string
- The current state of the rule.
- Stream
Id string - (Updatable) The OCID of the stream to which messages are delivered.
- Topic
Id string - (Updatable) The OCID of the topic to which messages are delivered.
- action
Type 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.
- is
Enabled 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.
- function
Id String - (Updatable) The OCID of a Function hosted by Oracle Functions Service.
- id String
- The OCID of this rule.
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- stream
Id String - (Updatable) The OCID of the stream to which messages are delivered.
- topic
Id String - (Updatable) The OCID of the topic to which messages are delivered.
- action
Type 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.
- is
Enabled 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.
- function
Id string - (Updatable) The OCID of a Function hosted by Oracle Functions Service.
- id string
- The OCID of this rule.
- lifecycle
Message string - A message generated by the Events service about the current state of this rule.
- state string
- The current state of the rule.
- stream
Id string - (Updatable) The OCID of the stream to which messages are delivered.
- topic
Id string - (Updatable) The OCID of the topic to which messages are delivered.
- action_
type 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 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.
- action
Type 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.
- is
Enabled 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.
- function
Id String - (Updatable) The OCID of a Function hosted by Oracle Functions Service.
- id String
- The OCID of this rule.
- lifecycle
Message String - A message generated by the Events service about the current state of this rule.
- state String
- The current state of the rule.
- stream
Id String - (Updatable) The OCID of the stream to which messages are delivered.
- topic
Id 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"
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.