1. Packages
  2. Ibm Provider
  3. API Docs
  4. FunctionRule
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.FunctionRule

Explore with Pulumi AI

Create, update, or delete an IBM Cloud Functions rule. Events from external and internal event sources are channeled through a trigger, and rules allow your actions to react to these events. To set triggers, use the function_trigger resource. For more information, see getting started with IBM Cloud Functions.

Create FunctionRule Resource

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

Constructor syntax

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

@overload
def FunctionRule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 action_name: Optional[str] = None,
                 namespace: Optional[str] = None,
                 trigger_name: Optional[str] = None,
                 function_rule_id: Optional[str] = None,
                 name: Optional[str] = None)
func NewFunctionRule(ctx *Context, name string, args FunctionRuleArgs, opts ...ResourceOption) (*FunctionRule, error)
public FunctionRule(string name, FunctionRuleArgs args, CustomResourceOptions? opts = null)
public FunctionRule(String name, FunctionRuleArgs args)
public FunctionRule(String name, FunctionRuleArgs args, CustomResourceOptions options)
type: ibm:FunctionRule
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. FunctionRuleArgs
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. FunctionRuleArgs
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. FunctionRuleArgs
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. FunctionRuleArgs
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. FunctionRuleArgs
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 functionRuleResource = new Ibm.FunctionRule("functionRuleResource", new()
{
    ActionName = "string",
    Namespace = "string",
    TriggerName = "string",
    FunctionRuleId = "string",
    Name = "string",
});
Copy
example, err := ibm.NewFunctionRule(ctx, "functionRuleResource", &ibm.FunctionRuleArgs{
ActionName: pulumi.String("string"),
Namespace: pulumi.String("string"),
TriggerName: pulumi.String("string"),
FunctionRuleId: pulumi.String("string"),
Name: pulumi.String("string"),
})
Copy
var functionRuleResource = new FunctionRule("functionRuleResource", FunctionRuleArgs.builder()
    .actionName("string")
    .namespace("string")
    .triggerName("string")
    .functionRuleId("string")
    .name("string")
    .build());
Copy
function_rule_resource = ibm.FunctionRule("functionRuleResource",
    action_name="string",
    namespace="string",
    trigger_name="string",
    function_rule_id="string",
    name="string")
Copy
const functionRuleResource = new ibm.FunctionRule("functionRuleResource", {
    actionName: "string",
    namespace: "string",
    triggerName: "string",
    functionRuleId: "string",
    name: "string",
});
Copy
type: ibm:FunctionRule
properties:
    actionName: string
    functionRuleId: string
    name: string
    namespace: string
    triggerName: string
Copy

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

ActionName This property is required. string
The name of the action.
Namespace This property is required. string
The name of the function namespace.
TriggerName This property is required. string
The name of the trigger.
FunctionRuleId string
(String) The ID of the new rule.
Name string
The name of the rule.
ActionName This property is required. string
The name of the action.
Namespace This property is required. string
The name of the function namespace.
TriggerName This property is required. string
The name of the trigger.
FunctionRuleId string
(String) The ID of the new rule.
Name string
The name of the rule.
actionName This property is required. String
The name of the action.
namespace This property is required. String
The name of the function namespace.
triggerName This property is required. String
The name of the trigger.
functionRuleId String
(String) The ID of the new rule.
name String
The name of the rule.
actionName This property is required. string
The name of the action.
namespace This property is required. string
The name of the function namespace.
triggerName This property is required. string
The name of the trigger.
functionRuleId string
(String) The ID of the new rule.
name string
The name of the rule.
action_name This property is required. str
The name of the action.
namespace This property is required. str
The name of the function namespace.
trigger_name This property is required. str
The name of the trigger.
function_rule_id str
(String) The ID of the new rule.
name str
The name of the rule.
actionName This property is required. String
The name of the action.
namespace This property is required. String
The name of the function namespace.
triggerName This property is required. String
The name of the trigger.
functionRuleId String
(String) The ID of the new rule.
name String
The name of the rule.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Publish bool
(Bool) Rule visibility.
RuleId string
(String) The rule ID.
Status string
(String) The status of the rule.
Version string
(String) Semantic version of the item.
Id string
The provider-assigned unique ID for this managed resource.
Publish bool
(Bool) Rule visibility.
RuleId string
(String) The rule ID.
Status string
(String) The status of the rule.
Version string
(String) Semantic version of the item.
id String
The provider-assigned unique ID for this managed resource.
publish Boolean
(Bool) Rule visibility.
ruleId String
(String) The rule ID.
status String
(String) The status of the rule.
version String
(String) Semantic version of the item.
id string
The provider-assigned unique ID for this managed resource.
publish boolean
(Bool) Rule visibility.
ruleId string
(String) The rule ID.
status string
(String) The status of the rule.
version string
(String) Semantic version of the item.
id str
The provider-assigned unique ID for this managed resource.
publish bool
(Bool) Rule visibility.
rule_id str
(String) The rule ID.
status str
(String) The status of the rule.
version str
(String) Semantic version of the item.
id String
The provider-assigned unique ID for this managed resource.
publish Boolean
(Bool) Rule visibility.
ruleId String
(String) The rule ID.
status String
(String) The status of the rule.
version String
(String) Semantic version of the item.

Look up Existing FunctionRule Resource

Get an existing FunctionRule 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?: FunctionRuleState, opts?: CustomResourceOptions): FunctionRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action_name: Optional[str] = None,
        function_rule_id: Optional[str] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None,
        publish: Optional[bool] = None,
        rule_id: Optional[str] = None,
        status: Optional[str] = None,
        trigger_name: Optional[str] = None,
        version: Optional[str] = None) -> FunctionRule
func GetFunctionRule(ctx *Context, name string, id IDInput, state *FunctionRuleState, opts ...ResourceOption) (*FunctionRule, error)
public static FunctionRule Get(string name, Input<string> id, FunctionRuleState? state, CustomResourceOptions? opts = null)
public static FunctionRule get(String name, Output<String> id, FunctionRuleState state, CustomResourceOptions options)
resources:  _:    type: ibm:FunctionRule    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:
ActionName string
The name of the action.
FunctionRuleId string
(String) The ID of the new rule.
Name string
The name of the rule.
Namespace string
The name of the function namespace.
Publish bool
(Bool) Rule visibility.
RuleId string
(String) The rule ID.
Status string
(String) The status of the rule.
TriggerName string
The name of the trigger.
Version string
(String) Semantic version of the item.
ActionName string
The name of the action.
FunctionRuleId string
(String) The ID of the new rule.
Name string
The name of the rule.
Namespace string
The name of the function namespace.
Publish bool
(Bool) Rule visibility.
RuleId string
(String) The rule ID.
Status string
(String) The status of the rule.
TriggerName string
The name of the trigger.
Version string
(String) Semantic version of the item.
actionName String
The name of the action.
functionRuleId String
(String) The ID of the new rule.
name String
The name of the rule.
namespace String
The name of the function namespace.
publish Boolean
(Bool) Rule visibility.
ruleId String
(String) The rule ID.
status String
(String) The status of the rule.
triggerName String
The name of the trigger.
version String
(String) Semantic version of the item.
actionName string
The name of the action.
functionRuleId string
(String) The ID of the new rule.
name string
The name of the rule.
namespace string
The name of the function namespace.
publish boolean
(Bool) Rule visibility.
ruleId string
(String) The rule ID.
status string
(String) The status of the rule.
triggerName string
The name of the trigger.
version string
(String) Semantic version of the item.
action_name str
The name of the action.
function_rule_id str
(String) The ID of the new rule.
name str
The name of the rule.
namespace str
The name of the function namespace.
publish bool
(Bool) Rule visibility.
rule_id str
(String) The rule ID.
status str
(String) The status of the rule.
trigger_name str
The name of the trigger.
version str
(String) Semantic version of the item.
actionName String
The name of the action.
functionRuleId String
(String) The ID of the new rule.
name String
The name of the rule.
namespace String
The name of the function namespace.
publish Boolean
(Bool) Rule visibility.
ruleId String
(String) The rule ID.
status String
(String) The status of the rule.
triggerName String
The name of the trigger.
version String
(String) Semantic version of the item.

Import

The ibm_function_rule resource can be imported by using the namespace and rule_id.

Syntax

$ pulumi import ibm:index/functionRule:FunctionRule sampleRule <namespace>:<rule_id>
Copy

Example

$ pulumi import ibm:index/functionRule:FunctionRule sampleRule alarmrule
Copy

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

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.