Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cms/getEventRules:getEventRules
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- Name
Prefix string - The name prefix.
- Name
Regex string - 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 string
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- Ids []string
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- Name
Prefix string - The name prefix.
- Name
Regex string - 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 string
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids List<String>
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix String - The name prefix.
- name
Regex String - 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 String
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids string[]
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix string - The name prefix.
- name
Regex string - 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 string
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids Sequence[str]
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name_
prefix str - The name prefix.
- name_
regex str - 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 str
- The status of the resource. Valid values:
DISABLED
,ENABLED
.
- ids List<String>
- A list of Event Rule IDs. Its element value is same as Event Rule Name.
- name
Prefix String - The name prefix.
- name
Regex String - 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 String
- 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 string
- The description of the rule.
- Event
Patterns 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 stringName - The name of the event rule.
- Event
Type string - The type of event.
- Group
Id string - The ID of the application Group.
- Id string
- The ID of the Event Rule. Its value is same as Event Rule Name.
- Silence
Time int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- Status string
- The status of the resource.
- Description string
- The description of the rule.
- Event
Patterns []GetEvent Rules Rule Event Pattern - Event mode, used to describe the trigger conditions for this event.
- Event
Rule stringName - The name of the event rule.
- Event
Type string - The type of event.
- Group
Id string - The ID of the application Group.
- Id string
- The ID of the Event Rule. Its value is same as Event Rule Name.
- Silence
Time int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- Status string
- The status of the resource.
- description String
- The description of the rule.
- event
Patterns List<GetEvent Rules Rule Event Pattern> - Event mode, used to describe the trigger conditions for this event.
- event
Rule StringName - The name of the event rule.
- event
Type String - The type of event.
- group
Id String - The ID of the application Group.
- id String
- The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time Integer - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status String
- The status of the resource.
- description string
- The description of the rule.
- event
Patterns GetEvent Rules Rule Event Pattern[] - Event mode, used to describe the trigger conditions for this event.
- event
Rule stringName - The name of the event rule.
- event
Type string - The type of event.
- group
Id string - The ID of the application Group.
- id string
- The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time number - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status string
- The status of the resource.
- description str
- The description of the rule.
- event_
patterns Sequence[GetEvent Rules Rule Event Pattern] - Event mode, used to describe the trigger conditions for this event.
- event_
rule_ strname - The name of the event rule.
- event_
type str - The type of event.
- group_
id str - The ID of the application Group.
- id str
- The ID of the Event Rule. Its value is same as Event Rule Name.
- silence_
time int - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status str
- The status of the resource.
- description String
- The description of the rule.
- event
Patterns List<Property Map> - Event mode, used to describe the trigger conditions for this event.
- event
Rule StringName - The name of the event rule.
- event
Type String - The type of event.
- group
Id String - The ID of the application Group.
- id String
- The ID of the Event Rule. Its value is same as Event Rule Name.
- silence
Time Number - The mute period during which new alerts are not sent even if the trigger conditions are met.
- status String
- The status of the resource.
GetEventRulesRuleEventPattern
- Event
Type List<string>Lists - The list of event types.
- Keyword
Filters List<Pulumi.Ali Cloud. Cms. Inputs. Get Event Rules Rule Event Pattern Keyword Filter> - The filter keyword.
- Level
Lists List<string> - The list of event levels.
- Name
Lists List<string> - The list of event names.
- Product string
- The type of the cloud service.
- Sql
Filter string - The SQL condition that is used to filter events.
- Event
Type []stringLists - The list of event types.
- Keyword
Filters []GetEvent Rules Rule Event Pattern Keyword Filter - The filter keyword.
- Level
Lists []string - The list of event levels.
- Name
Lists []string - The list of event names.
- Product string
- The type of the cloud service.
- Sql
Filter string - The SQL condition that is used to filter events.
- event
Type List<String>Lists - The list of event types.
- keyword
Filters List<GetEvent Rules Rule Event Pattern Keyword Filter> - The filter keyword.
- level
Lists List<String> - The list of event levels.
- name
Lists List<String> - The list of event names.
- product String
- The type of the cloud service.
- sql
Filter String - The SQL condition that is used to filter events.
- event
Type string[]Lists - The list of event types.
- keyword
Filters GetEvent Rules Rule Event Pattern Keyword Filter[] - The filter keyword.
- level
Lists string[] - The list of event levels.
- name
Lists string[] - The list of event names.
- product string
- The type of the cloud service.
- sql
Filter string - The SQL condition that is used to filter events.
- event_
type_ Sequence[str]lists - The list of event types.
- keyword_
filters Sequence[GetEvent Rules Rule Event Pattern Keyword Filter] - The filter keyword.
- level_
lists Sequence[str] - The list of event levels.
- name_
lists Sequence[str] - The list of event names.
- product str
- The type of the cloud service.
- sql_
filter str - The SQL condition that is used to filter events.
- event
Type List<String>Lists - The list of event types.
- keyword
Filters List<Property Map> - The filter keyword.
- level
Lists List<String> - The list of event levels.
- name
Lists List<String> - The list of event names.
- product String
- The type of the cloud service.
- sql
Filter 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.