getMonitorGroups

This data source provides the Cms Monitor Groups of the current Alibaba Cloud user.

NOTE: Available in v1.113.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.cms.getMonitorGroups({
ids: ["example_value"],
nameRegex: "the_resource_name",
});
export const firstCmsMonitorGroupId = example.then(example => example.groups?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.cms.get_monitor_groups(ids=["example_value"],
name_regex="the_resource_name")
pulumi.export("firstCmsMonitorGroupId", example.groups[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Cms.GetMonitorGroups.Invoke(new()
{
Ids = new[]
{
"example_value",
},
NameRegex = "the_resource_name",
});
return new Dictionary<string, object?>
{
["firstCmsMonitorGroupId"] = example&#46;Apply(getMonitorGroupsResult => getMonitorGroupsResult&#46;Groups[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 {
example, err := cms.GetMonitorGroups(ctx, &cms.GetMonitorGroupsArgs{
Ids: []string{
"example_value",
},
NameRegex: pulumi.StringRef("the_resource_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstCmsMonitorGroupId", example.Groups[0].Id)
return nil
})
}
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.GetMonitorGroupsArgs;
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 example = CmsFunctions.getMonitorGroups(GetMonitorGroupsArgs.builder()
.ids("example_value")
.nameRegex("the_resource_name")
.build());
ctx.export("firstCmsMonitorGroupId", example.applyValue(getMonitorGroupsResult -> getMonitorGroupsResult.groups()[0].id()));
}
}
variables:
example:
fn::invoke:
Function: alicloud:cms:getMonitorGroups
Arguments:
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstCmsMonitorGroupId: ${example.groups[0].id}

Return

A collection of values returned by getMonitorGroups.

Parameters

argument

A collection of arguments for invoking getMonitorGroups.


suspend fun getMonitorGroups(dynamicTagRuleId: String? = null, ids: List<String>? = null, includeTemplateHistory: Boolean? = null, keyword: String? = null, monitorGroupName: String? = null, nameRegex: String? = null, outputFile: String? = null, selectContactGroups: Boolean? = null, tags: Map<String, Any>? = null, type: String? = null): GetMonitorGroupsResult

Return

A collection of values returned by getMonitorGroups.

See also

Parameters

dynamicTagRuleId

The ID of the tag rule.

ids

A list of Monitor Group IDs.

includeTemplateHistory

The include template history.

keyword

The keyword to be matched.

monitorGroupName

The name of the application group.

nameRegex

A regex string to filter results by Monitor Group name.

outputFile

File name where to save data source results (after running pulumi preview).

selectContactGroups

The select contact groups.

tags

A map of tags assigned to the Cms Monitor Group.

type

The type of the application group.


Return

A collection of values returned by getMonitorGroups.

See also

Parameters

argument

Builder for com.pulumi.alicloud.cms.kotlin.inputs.GetMonitorGroupsPlainArgs.