1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. getDispatchRules
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.arms.getDispatchRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Arms Dispatch Rules of the current Alibaba Cloud user.

    NOTE: Available in v1.136.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.arms.getDispatchRules({});
    export const armsDispatchRuleId1 = ids.then(ids => ids.rules?.[0]?.id);
    const nameRegex = alicloud.arms.getDispatchRules({
        nameRegex: "^my-DispatchRule",
    });
    export const armsDispatchRuleId2 = nameRegex.then(nameRegex => nameRegex.rules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.arms.get_dispatch_rules()
    pulumi.export("armsDispatchRuleId1", ids.rules[0].id)
    name_regex = alicloud.arms.get_dispatch_rules(name_regex="^my-DispatchRule")
    pulumi.export("armsDispatchRuleId2", name_regex.rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := arms.GetDispatchRules(ctx, &arms.GetDispatchRulesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsDispatchRuleId1", ids.Rules[0].Id)
    		nameRegex, err := arms.GetDispatchRules(ctx, &arms.GetDispatchRulesArgs{
    			NameRegex: pulumi.StringRef("^my-DispatchRule"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsDispatchRuleId2", 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.Arms.GetDispatchRules.Invoke();
    
        var nameRegex = AliCloud.Arms.GetDispatchRules.Invoke(new()
        {
            NameRegex = "^my-DispatchRule",
        });
    
        return new Dictionary<string, object?>
        {
            ["armsDispatchRuleId1"] = ids.Apply(getDispatchRulesResult => getDispatchRulesResult.Rules[0]?.Id),
            ["armsDispatchRuleId2"] = nameRegex.Apply(getDispatchRulesResult => getDispatchRulesResult.Rules[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.arms.ArmsFunctions;
    import com.pulumi.alicloud.arms.inputs.GetDispatchRulesArgs;
    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 = ArmsFunctions.getDispatchRules();
    
            ctx.export("armsDispatchRuleId1", ids.applyValue(getDispatchRulesResult -> getDispatchRulesResult.rules()[0].id()));
            final var nameRegex = ArmsFunctions.getDispatchRules(GetDispatchRulesArgs.builder()
                .nameRegex("^my-DispatchRule")
                .build());
    
            ctx.export("armsDispatchRuleId2", nameRegex.applyValue(getDispatchRulesResult -> getDispatchRulesResult.rules()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:arms:getDispatchRules
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:arms:getDispatchRules
          Arguments:
            nameRegex: ^my-DispatchRule
    outputs:
      armsDispatchRuleId1: ${ids.rules[0].id}
      armsDispatchRuleId2: ${nameRegex.rules[0].id}
    

    Using getDispatchRules

    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 getDispatchRules(args: GetDispatchRulesArgs, opts?: InvokeOptions): Promise<GetDispatchRulesResult>
    function getDispatchRulesOutput(args: GetDispatchRulesOutputArgs, opts?: InvokeOptions): Output<GetDispatchRulesResult>
    def get_dispatch_rules(dispatch_rule_name: Optional[str] = None,
                           enable_details: Optional[bool] = None,
                           ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDispatchRulesResult
    def get_dispatch_rules_output(dispatch_rule_name: Optional[pulumi.Input[str]] = None,
                           enable_details: Optional[pulumi.Input[bool]] = None,
                           ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           name_regex: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDispatchRulesResult]
    func GetDispatchRules(ctx *Context, args *GetDispatchRulesArgs, opts ...InvokeOption) (*GetDispatchRulesResult, error)
    func GetDispatchRulesOutput(ctx *Context, args *GetDispatchRulesOutputArgs, opts ...InvokeOption) GetDispatchRulesResultOutput

    > Note: This function is named GetDispatchRules in the Go SDK.

    public static class GetDispatchRules 
    {
        public static Task<GetDispatchRulesResult> InvokeAsync(GetDispatchRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetDispatchRulesResult> Invoke(GetDispatchRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDispatchRulesResult> getDispatchRules(GetDispatchRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getDispatchRules:getDispatchRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DispatchRuleName string
    The name of the dispatch rule.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of dispatch rule id.
    NameRegex string
    A regex string to filter results by Dispatch Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    DispatchRuleName string
    The name of the dispatch rule.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of dispatch rule id.
    NameRegex string
    A regex string to filter results by Dispatch Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    dispatchRuleName String
    The name of the dispatch rule.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of dispatch rule id.
    nameRegex String
    A regex string to filter results by Dispatch Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    dispatchRuleName string
    The name of the dispatch rule.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of dispatch rule id.
    nameRegex string
    A regex string to filter results by Dispatch Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    dispatch_rule_name str
    The name of the dispatch rule.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of dispatch rule id.
    name_regex str
    A regex string to filter results by Dispatch Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    dispatchRuleName String
    The name of the dispatch rule.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of dispatch rule id.
    nameRegex String
    A regex string to filter results by Dispatch Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getDispatchRules 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.AliCloud.Arms.Outputs.GetDispatchRulesRule>
    DispatchRuleName string
    EnableDetails bool
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Rules []GetDispatchRulesRule
    DispatchRuleName string
    EnableDetails bool
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    rules List<GetDispatchRulesRule>
    dispatchRuleName String
    enableDetails Boolean
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    rules GetDispatchRulesRule[]
    dispatchRuleName string
    enableDetails boolean
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    rules Sequence[GetDispatchRulesRule]
    dispatch_rule_name str
    enable_details bool
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    rules List<Property Map>
    dispatchRuleName String
    enableDetails Boolean
    nameRegex String
    outputFile String

    Supporting Types

    GetDispatchRulesRule

    DispatchRuleId string
    Dispatch rule ID.
    DispatchRuleName string
    The name of the dispatch rule.
    DispatchType string
    GroupRules List<Pulumi.AliCloud.Arms.Inputs.GetDispatchRulesRuleGroupRule>
    Sets the event group.
    Id string
    The ID of the Dispatch Rule.
    LabelMatchExpressionGrids List<Pulumi.AliCloud.Arms.Inputs.GetDispatchRulesRuleLabelMatchExpressionGrid>
    Sets the dispatch rule.
    NotifyRules List<Pulumi.AliCloud.Arms.Inputs.GetDispatchRulesRuleNotifyRule>
    Sets the notification rule.
    Status string
    The resource status of Alert Dispatch Rule.
    DispatchRuleId string
    Dispatch rule ID.
    DispatchRuleName string
    The name of the dispatch rule.
    DispatchType string
    GroupRules []GetDispatchRulesRuleGroupRule
    Sets the event group.
    Id string
    The ID of the Dispatch Rule.
    LabelMatchExpressionGrids []GetDispatchRulesRuleLabelMatchExpressionGrid
    Sets the dispatch rule.
    NotifyRules []GetDispatchRulesRuleNotifyRule
    Sets the notification rule.
    Status string
    The resource status of Alert Dispatch Rule.
    dispatchRuleId String
    Dispatch rule ID.
    dispatchRuleName String
    The name of the dispatch rule.
    dispatchType String
    groupRules List<GetDispatchRulesRuleGroupRule>
    Sets the event group.
    id String
    The ID of the Dispatch Rule.
    labelMatchExpressionGrids List<GetDispatchRulesRuleLabelMatchExpressionGrid>
    Sets the dispatch rule.
    notifyRules List<GetDispatchRulesRuleNotifyRule>
    Sets the notification rule.
    status String
    The resource status of Alert Dispatch Rule.
    dispatchRuleId string
    Dispatch rule ID.
    dispatchRuleName string
    The name of the dispatch rule.
    dispatchType string
    groupRules GetDispatchRulesRuleGroupRule[]
    Sets the event group.
    id string
    The ID of the Dispatch Rule.
    labelMatchExpressionGrids GetDispatchRulesRuleLabelMatchExpressionGrid[]
    Sets the dispatch rule.
    notifyRules GetDispatchRulesRuleNotifyRule[]
    Sets the notification rule.
    status string
    The resource status of Alert Dispatch Rule.
    dispatch_rule_id str
    Dispatch rule ID.
    dispatch_rule_name str
    The name of the dispatch rule.
    dispatch_type str
    group_rules Sequence[GetDispatchRulesRuleGroupRule]
    Sets the event group.
    id str
    The ID of the Dispatch Rule.
    label_match_expression_grids Sequence[GetDispatchRulesRuleLabelMatchExpressionGrid]
    Sets the dispatch rule.
    notify_rules Sequence[GetDispatchRulesRuleNotifyRule]
    Sets the notification rule.
    status str
    The resource status of Alert Dispatch Rule.
    dispatchRuleId String
    Dispatch rule ID.
    dispatchRuleName String
    The name of the dispatch rule.
    dispatchType String
    groupRules List<Property Map>
    Sets the event group.
    id String
    The ID of the Dispatch Rule.
    labelMatchExpressionGrids List<Property Map>
    Sets the dispatch rule.
    notifyRules List<Property Map>
    Sets the notification rule.
    status String
    The resource status of Alert Dispatch Rule.

    GetDispatchRulesRuleGroupRule

    GroupId int
    GroupInterval int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    GroupWaitTime int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    GroupingFields List<string>
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    RepeatInterval int
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
    GroupId int
    GroupInterval int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    GroupWaitTime int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    GroupingFields []string
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    RepeatInterval int
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
    groupId Integer
    groupInterval Integer
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupWaitTime Integer
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupingFields List<String>
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    repeatInterval Integer
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
    groupId number
    groupInterval number
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupWaitTime number
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupingFields string[]
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    repeatInterval number
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
    group_id int
    group_interval int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    group_wait_time int
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    grouping_fields Sequence[str]
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    repeat_interval int
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
    groupId Number
    groupInterval Number
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupWaitTime Number
    The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
    groupingFields List<String>
    The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
    repeatInterval Number
    The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.

    GetDispatchRulesRuleLabelMatchExpressionGrid

    GetDispatchRulesRuleLabelMatchExpressionGridLabelMatchExpressionGroup

    GetDispatchRulesRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpression

    Key string
    The key of the tag of the dispatch rule.
    Operator string
    The operator used in the dispatch rule.
    Value string
    The value of the tag.
    Key string
    The key of the tag of the dispatch rule.
    Operator string
    The operator used in the dispatch rule.
    Value string
    The value of the tag.
    key String
    The key of the tag of the dispatch rule.
    operator String
    The operator used in the dispatch rule.
    value String
    The value of the tag.
    key string
    The key of the tag of the dispatch rule.
    operator string
    The operator used in the dispatch rule.
    value string
    The value of the tag.
    key str
    The key of the tag of the dispatch rule.
    operator str
    The operator used in the dispatch rule.
    value str
    The value of the tag.
    key String
    The key of the tag of the dispatch rule.
    operator String
    The operator used in the dispatch rule.
    value String
    The value of the tag.

    GetDispatchRulesRuleNotifyRule

    NotifyChannels []string
    The notification method.
    NotifyObjects []GetDispatchRulesRuleNotifyRuleNotifyObject
    Sets the notification object.
    notifyChannels List<String>
    The notification method.
    notifyObjects List<GetDispatchRulesRuleNotifyRuleNotifyObject>
    Sets the notification object.
    notifyChannels string[]
    The notification method.
    notifyObjects GetDispatchRulesRuleNotifyRuleNotifyObject[]
    Sets the notification object.
    notify_channels Sequence[str]
    The notification method.
    notify_objects Sequence[GetDispatchRulesRuleNotifyRuleNotifyObject]
    Sets the notification object.
    notifyChannels List<String>
    The notification method.
    notifyObjects List<Property Map>
    Sets the notification object.

    GetDispatchRulesRuleNotifyRuleNotifyObject

    Name string
    The name of the contact or contact group.
    NotifyObjectId string
    The ID of the contact or contact group.
    NotifyType string
    The type of the alert contact.
    Name string
    The name of the contact or contact group.
    NotifyObjectId string
    The ID of the contact or contact group.
    NotifyType string
    The type of the alert contact.
    name String
    The name of the contact or contact group.
    notifyObjectId String
    The ID of the contact or contact group.
    notifyType String
    The type of the alert contact.
    name string
    The name of the contact or contact group.
    notifyObjectId string
    The ID of the contact or contact group.
    notifyType string
    The type of the alert contact.
    name str
    The name of the contact or contact group.
    notify_object_id str
    The ID of the contact or contact group.
    notify_type str
    The type of the alert contact.
    name String
    The name of the contact or contact group.
    notifyObjectId String
    The ID of the contact or contact group.
    notifyType String
    The type of the alert contact.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi