Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.cms.getEventRules
Explore with Pulumi AI
This data source provides the Cms Event Rules of the current Alibaba Cloud user.
NOTE: Available in v1.182.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.cms.getEventRules({
ids: ["example_id"],
});
export const cmsEventRuleId1 = ids.then(ids => ids.rules?.[0]?.id);
const nameRegex = alicloud.cms.getEventRules({
nameRegex: "^my-EventRule",
});
export const cmsEventRuleId2 = nameRegex.then(nameRegex => nameRegex.rules?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cms.get_event_rules(ids=["example_id"])
pulumi.export("cmsEventRuleId1", ids.rules[0].id)
name_regex = alicloud.cms.get_event_rules(name_regex="^my-EventRule")
pulumi.export("cmsEventRuleId2", name_regex.rules[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := cms.GetEventRules(ctx, &cms.GetEventRulesArgs{
Ids: []string{
"example_id",
},
}, nil)
if err != nil {
return err
}
ctx.Export("cmsEventRuleId1", ids.Rules[0].Id)
nameRegex, err := cms.GetEventRules(ctx, &cms.GetEventRulesArgs{
NameRegex: pulumi.StringRef("^my-EventRule"),
}, nil)
if err != nil {
return err
}
ctx.Export("cmsEventRuleId2", nameRegex.Rules[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Cms.GetEventRules.Invoke(new()
{
Ids = new[]
{
"example_id",
},
});
var nameRegex = AliCloud.Cms.GetEventRules.Invoke(new()
{
NameRegex = "^my-EventRule",
});
return new Dictionary<string, object?>
{
["cmsEventRuleId1"] = ids.Apply(getEventRulesResult => getEventRulesResult.Rules[0]?.Id),
["cmsEventRuleId2"] = nameRegex.Apply(getEventRulesResult => getEventRulesResult.Rules[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cms.CmsFunctions;
import com.pulumi.alicloud.cms.inputs.GetEventRulesArgs;
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) {
final var ids = CmsFunctions.getEventRules(GetEventRulesArgs.builder()
.ids("example_id")
.build());
ctx.export("cmsEventRuleId1", ids.applyValue(getEventRulesResult -> getEventRulesResult.rules()[0].id()));
final var nameRegex = CmsFunctions.getEventRules(GetEventRulesArgs.builder()
.nameRegex("^my-EventRule")
.build());
ctx.export("cmsEventRuleId2", nameRegex.applyValue(getEventRulesResult -> getEventRulesResult.rules()[0].id()));
}
}
variables:
ids:
fn::invoke:
function: alicloud:cms:getEventRules
arguments:
ids:
- example_id
nameRegex:
fn::invoke:
function: alicloud:cms:getEventRules
arguments:
nameRegex: ^my-EventRule
outputs:
cmsEventRuleId1: ${ids.rules[0].id}
cmsEventRuleId2: ${nameRegex.rules[0].id}
Using getEventRules
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEventRules(args: GetEventRulesArgs, opts?: InvokeOptions): Promise<GetEventRulesResult>
function getEventRulesOutput(args: GetEventRulesOutputArgs, opts?: InvokeOptions): Output<GetEventRulesResult>
def get_event_rules(ids: Optional[Sequence[str]] = None,
name_prefix: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
page_number: Optional[int] = None,
page_size: Optional[int] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEventRulesResult
def get_event_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_prefix: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
page_number: Optional[pulumi.Input[int]] = None,
page_size: Optional[pulumi.Input[int]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetEventRulesResult]
func GetEventRules(ctx *Context, args *GetEventRulesArgs, opts ...InvokeOption) (*GetEventRulesResult, error)
func GetEventRulesOutput(ctx *Context, args *GetEventRulesOutputArgs, opts ...InvokeOption) GetEventRulesResultOutput
> Note: This function is named GetEventRules
in the Go SDK.
public static class GetEventRules
{
public static Task<GetEventRulesResult> InvokeAsync(GetEventRulesArgs args, InvokeOptions? opts = null)
public static Output<GetEventRulesResult> Invoke(GetEventRulesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEventRulesResult> getEventRules(GetEventRulesArgs args, InvokeOptions options)
public static Output<GetEventRulesResult> getEventRules(GetEventRulesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:cms/getEventRules:getEventRules
arguments:
# arguments dictionary
The following arguments are supported:
- Ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- Name
Prefix Changes to this property will trigger replacement.
- The name prefix.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int - Status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- Ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- Name
Prefix Changes to this property will trigger replacement.
- The name prefix.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int - Status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix Changes to this property will trigger replacement.
- The name prefix.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Integer - page
Size Integer - status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix Changes to this property will trigger replacement.
- The name prefix.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - page
Number number - page
Size number - status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name_
prefix Changes to this property will trigger replacement.
- The name prefix.
- name_
regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - page_
number int - page_
size int - status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids
Changes to this property will trigger replacement.
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix Changes to this property will trigger replacement.
- The name prefix.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Event Rule name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Number - page
Size Number - status
Changes to this property will trigger replacement.
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
getEventRules Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Rules
List<Pulumi.
Ali Cloud. Cms. Outputs. Get Event Rules Rule> - Name
Prefix string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Rules
[]Get
Event Rules Rule - Name
Prefix string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- rules
List<Get
Event Rules Rule> - name
Prefix String - name
Regex String - output
File String - page
Number Integer - page
Size Integer - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- rules
Get
Event Rules Rule[] - name
Prefix string - name
Regex string - output
File string - page
Number number - page
Size number - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- rules
Sequence[Get
Event Rules Rule] - name_
prefix str - name_
regex str - output_
file str - page_
number int - page_
size int - status str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- rules List<Property Map>
- name
Prefix String - name
Regex String - output
File String - page
Number Number - page
Size Number - status String
Supporting Types
GetEventRulesRule
- Description
This property is required. string - The description of the rule.
- Event
Patterns This property is required. List<Pulumi.Ali Cloud. Cms. Inputs. Get Event Rules Rule Event Pattern> - Event mode, used to describe the trigger conditions for this event.
- Event
Rule Name This property is required. string - The name of the event rule.
- Event
Type This property is required. string - The type of event.
- Group
Id This property is required. string - The ID of the application Group.
- Id
This property is required. string - The ID of the Event Rule. Its value is same as Event Rule Name.
- Silence
Time This property is required. int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- Status
This property is required. string - The status of the resource.
- Description
This property is required. string - The description of the rule.
- Event
Patterns This property is required. []GetEvent Rules Rule Event Pattern - Event mode, used to describe the trigger conditions for this event.
- Event
Rule Name This property is required. string - The name of the event rule.
- Event
Type This property is required. string - The type of event.
- Group
Id This property is required. string - The ID of the application Group.
- Id
This property is required. string - The ID of the Event Rule. Its value is same as Event Rule Name.
- Silence
Time This property is required. int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- Status
This property is required. string - The status of the resource.
- description
This property is required. String - The description of the rule.
- event
Patterns This property is required. List<GetEvent Rules Rule Event Pattern> - Event mode, used to describe the trigger conditions for this event.
- event
Rule Name This property is required. String - The name of the event rule.
- event
Type This property is required. String - The type of event.
- group
Id This property is required. String - The ID of the application Group.
- id
This property is required. String - The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time This property is required. Integer - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status
This property is required. String - The status of the resource.
- description
This property is required. string - The description of the rule.
- event
Patterns This property is required. GetEvent Rules Rule Event Pattern[] - Event mode, used to describe the trigger conditions for this event.
- event
Rule Name This property is required. string - The name of the event rule.
- event
Type This property is required. string - The type of event.
- group
Id This property is required. string - The ID of the application Group.
- id
This property is required. string - The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time This property is required. number - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status
This property is required. string - The status of the resource.
- description
This property is required. str - The description of the rule.
- event_
patterns This property is required. Sequence[GetEvent Rules Rule Event Pattern] - Event mode, used to describe the trigger conditions for this event.
- event_
rule_ name This property is required. str - The name of the event rule.
- event_
type This property is required. str - The type of event.
- group_
id This property is required. str - The ID of the application Group.
- id
This property is required. str - The ID of the Event Rule. Its value is same as Event Rule Name.
- silence_
time This property is required. int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status
This property is required. str - The status of the resource.
- description
This property is required. String - The description of the rule.
- event
Patterns This property is required. List<Property Map> - Event mode, used to describe the trigger conditions for this event.
- event
Rule Name This property is required. String - The name of the event rule.
- event
Type This property is required. String - The type of event.
- group
Id This property is required. String - The ID of the application Group.
- id
This property is required. String - The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time This property is required. Number - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status
This property is required. String - The status of the resource.
GetEventRulesRuleEventPattern
- Event
Type Lists This property is required. List<string> - The list of event types.
- Keyword
Filters This property is required. List<Pulumi.Ali Cloud. Cms. Inputs. Get Event Rules Rule Event Pattern Keyword Filter> - The filter keyword.
- Level
Lists This property is required. List<string> - The list of event levels.
- Name
Lists This property is required. List<string> - The list of event names.
- Product
This property is required. string - The type of the cloud service.
- Sql
Filter This property is required. string - The SQL condition that is used to filter events.
- Event
Type Lists This property is required. []string - The list of event types.
- Keyword
Filters This property is required. []GetEvent Rules Rule Event Pattern Keyword Filter - The filter keyword.
- Level
Lists This property is required. []string - The list of event levels.
- Name
Lists This property is required. []string - The list of event names.
- Product
This property is required. string - The type of the cloud service.
- Sql
Filter This property is required. string - The SQL condition that is used to filter events.
- event
Type Lists This property is required. List<String> - The list of event types.
- keyword
Filters This property is required. List<GetEvent Rules Rule Event Pattern Keyword Filter> - The filter keyword.
- level
Lists This property is required. List<String> - The list of event levels.
- name
Lists This property is required. List<String> - The list of event names.
- product
This property is required. String - The type of the cloud service.
- sql
Filter This property is required. String - The SQL condition that is used to filter events.
- event
Type Lists This property is required. string[] - The list of event types.
- keyword
Filters This property is required. GetEvent Rules Rule Event Pattern Keyword Filter[] - The filter keyword.
- level
Lists This property is required. string[] - The list of event levels.
- name
Lists This property is required. string[] - The list of event names.
- product
This property is required. string - The type of the cloud service.
- sql
Filter This property is required. string - The SQL condition that is used to filter events.
- event_
type_ lists This property is required. Sequence[str] - The list of event types.
- keyword_
filters This property is required. Sequence[GetEvent Rules Rule Event Pattern Keyword Filter] - The filter keyword.
- level_
lists This property is required. Sequence[str] - The list of event levels.
- name_
lists This property is required. Sequence[str] - The list of event names.
- product
This property is required. str - The type of the cloud service.
- sql_
filter This property is required. str - The SQL condition that is used to filter events.
- event
Type Lists This property is required. List<String> - The list of event types.
- keyword
Filters This property is required. List<Property Map> - The filter keyword.
- level
Lists This property is required. List<String> - The list of event levels.
- name
Lists This property is required. List<String> - The list of event names.
- product
This property is required. String - The type of the cloud service.
- sql
Filter This property is required. String - The SQL condition that is used to filter events.
GetEventRulesRuleEventPatternKeywordFilter
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.