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 string
- The unique name of the resource.
- args FunctionRuleArgs
- 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 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 string
- The unique name of the resource.
- args FunctionRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var functionRuleResource = new FunctionRule("functionRuleResource", FunctionRuleArgs.builder()
.actionName("string")
.namespace("string")
.triggerName("string")
.functionRuleId("string")
.name("string")
.build());
function_rule_resource = ibm.FunctionRule("functionRuleResource",
action_name="string",
namespace="string",
trigger_name="string",
function_rule_id="string",
name="string")
const functionRuleResource = new ibm.FunctionRule("functionRuleResource", {
actionName: "string",
namespace: "string",
triggerName: "string",
functionRuleId: "string",
name: "string",
});
type: ibm:FunctionRule
properties:
actionName: string
functionRuleId: string
name: string
namespace: string
triggerName: string
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:
- Action
Name string - The name of the action.
- Namespace string
- The name of the function namespace.
- Trigger
Name string - The name of the trigger.
- Function
Rule stringId - (String) The ID of the new rule.
- Name string
- The name of the rule.
- Action
Name string - The name of the action.
- Namespace string
- The name of the function namespace.
- Trigger
Name string - The name of the trigger.
- Function
Rule stringId - (String) The ID of the new rule.
- Name string
- The name of the rule.
- action
Name String - The name of the action.
- namespace String
- The name of the function namespace.
- trigger
Name String - The name of the trigger.
- function
Rule StringId - (String) The ID of the new rule.
- name String
- The name of the rule.
- action
Name string - The name of the action.
- namespace string
- The name of the function namespace.
- trigger
Name string - The name of the trigger.
- function
Rule stringId - (String) The ID of the new rule.
- name string
- The name of the rule.
- action_
name str - The name of the action.
- namespace str
- The name of the function namespace.
- trigger_
name str - The name of the trigger.
- function_
rule_ strid - (String) The ID of the new rule.
- name str
- The name of the rule.
- action
Name String - The name of the action.
- namespace String
- The name of the function namespace.
- trigger
Name String - The name of the trigger.
- function
Rule StringId - (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:
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
- 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.
- Action
Name string - The name of the action.
- Function
Rule stringId - (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.
- Rule
Id string - (String) The rule ID.
- Status string
- (String) The status of the rule.
- Trigger
Name string - The name of the trigger.
- Version string
- (String) Semantic version of the item.
- Action
Name string - The name of the action.
- Function
Rule stringId - (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.
- Rule
Id string - (String) The rule ID.
- Status string
- (String) The status of the rule.
- Trigger
Name string - The name of the trigger.
- Version string
- (String) Semantic version of the item.
- action
Name String - The name of the action.
- function
Rule StringId - (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.
- rule
Id String - (String) The rule ID.
- status String
- (String) The status of the rule.
- trigger
Name String - The name of the trigger.
- version String
- (String) Semantic version of the item.
- action
Name string - The name of the action.
- function
Rule stringId - (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.
- rule
Id string - (String) The rule ID.
- status string
- (String) The status of the rule.
- trigger
Name string - The name of the trigger.
- version string
- (String) Semantic version of the item.
- action_
name str - The name of the action.
- function_
rule_ strid - (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.
- action
Name String - The name of the action.
- function
Rule StringId - (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.
- rule
Id String - (String) The rule ID.
- status String
- (String) The status of the rule.
- trigger
Name 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>
Example
$ pulumi import ibm:index/functionRule:FunctionRule sampleRule alarmrule
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.