alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cms.DynamicTagGroup

Provides a Cloud Monitor Service Dynamic Tag Group resource.

For information about Cloud Monitor Service Dynamic Tag Group and how to use it, see What is Dynamic Tag Group.

NOTE: Available in v1.142.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultAlarmContactGroup = new AliCloud.Cms.AlarmContactGroup("defaultAlarmContactGroup", new()
    {
        AlarmContactGroupName = "example_value",
        Describe = "example_value",
        EnableSubscribed = true,
    });

    var defaultDynamicTagGroup = new AliCloud.Cms.DynamicTagGroup("defaultDynamicTagGroup", new()
    {
        ContactGroupLists = new[]
        {
            defaultAlarmContactGroup.Id,
        },
        TagKey = "your_tag_key",
        MatchExpresses = new[]
        {
            new AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs
            {
                TagValue = "your_tag_value",
                TagValueMatchFunction = "all",
            },
        },
    });

});
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 {
		defaultAlarmContactGroup, err := cms.NewAlarmContactGroup(ctx, "defaultAlarmContactGroup", &cms.AlarmContactGroupArgs{
			AlarmContactGroupName: pulumi.String("example_value"),
			Describe:              pulumi.String("example_value"),
			EnableSubscribed:      pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = cms.NewDynamicTagGroup(ctx, "defaultDynamicTagGroup", &cms.DynamicTagGroupArgs{
			ContactGroupLists: pulumi.StringArray{
				defaultAlarmContactGroup.ID(),
			},
			TagKey: pulumi.String("your_tag_key"),
			MatchExpresses: cms.DynamicTagGroupMatchExpressArray{
				&cms.DynamicTagGroupMatchExpressArgs{
					TagValue:              pulumi.String("your_tag_value"),
					TagValueMatchFunction: pulumi.String("all"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cms.AlarmContactGroup;
import com.pulumi.alicloud.cms.AlarmContactGroupArgs;
import com.pulumi.alicloud.cms.DynamicTagGroup;
import com.pulumi.alicloud.cms.DynamicTagGroupArgs;
import com.pulumi.alicloud.cms.inputs.DynamicTagGroupMatchExpressArgs;
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) {
        var defaultAlarmContactGroup = new AlarmContactGroup("defaultAlarmContactGroup", AlarmContactGroupArgs.builder()        
            .alarmContactGroupName("example_value")
            .describe("example_value")
            .enableSubscribed(true)
            .build());

        var defaultDynamicTagGroup = new DynamicTagGroup("defaultDynamicTagGroup", DynamicTagGroupArgs.builder()        
            .contactGroupLists(defaultAlarmContactGroup.id())
            .tagKey("your_tag_key")
            .matchExpresses(DynamicTagGroupMatchExpressArgs.builder()
                .tagValue("your_tag_value")
                .tagValueMatchFunction("all")
                .build())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_alarm_contact_group = alicloud.cms.AlarmContactGroup("defaultAlarmContactGroup",
    alarm_contact_group_name="example_value",
    describe="example_value",
    enable_subscribed=True)
default_dynamic_tag_group = alicloud.cms.DynamicTagGroup("defaultDynamicTagGroup",
    contact_group_lists=[default_alarm_contact_group.id],
    tag_key="your_tag_key",
    match_expresses=[alicloud.cms.DynamicTagGroupMatchExpressArgs(
        tag_value="your_tag_value",
        tag_value_match_function="all",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultAlarmContactGroup = new alicloud.cms.AlarmContactGroup("defaultAlarmContactGroup", {
    alarmContactGroupName: "example_value",
    describe: "example_value",
    enableSubscribed: true,
});
const defaultDynamicTagGroup = new alicloud.cms.DynamicTagGroup("defaultDynamicTagGroup", {
    contactGroupLists: [defaultAlarmContactGroup.id],
    tagKey: "your_tag_key",
    matchExpresses: [{
        tagValue: "your_tag_value",
        tagValueMatchFunction: "all",
    }],
});
resources:
  defaultAlarmContactGroup:
    type: alicloud:cms:AlarmContactGroup
    properties:
      alarmContactGroupName: example_value
      describe: example_value
      enableSubscribed: true
  defaultDynamicTagGroup:
    type: alicloud:cms:DynamicTagGroup
    properties:
      contactGroupLists:
        - ${defaultAlarmContactGroup.id}
      tagKey: your_tag_key
      matchExpresses:
        - tagValue: your_tag_value
          tagValueMatchFunction: all

Create DynamicTagGroup Resource

new DynamicTagGroup(name: string, args: DynamicTagGroupArgs, opts?: CustomResourceOptions);
@overload
def DynamicTagGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    contact_group_lists: Optional[Sequence[str]] = None,
                    match_express_filter_relation: Optional[str] = None,
                    match_expresses: Optional[Sequence[DynamicTagGroupMatchExpressArgs]] = None,
                    tag_key: Optional[str] = None,
                    template_id_lists: Optional[Sequence[str]] = None)
@overload
def DynamicTagGroup(resource_name: str,
                    args: DynamicTagGroupArgs,
                    opts: Optional[ResourceOptions] = None)
func NewDynamicTagGroup(ctx *Context, name string, args DynamicTagGroupArgs, opts ...ResourceOption) (*DynamicTagGroup, error)
public DynamicTagGroup(string name, DynamicTagGroupArgs args, CustomResourceOptions? opts = null)
public DynamicTagGroup(String name, DynamicTagGroupArgs args)
public DynamicTagGroup(String name, DynamicTagGroupArgs args, CustomResourceOptions options)
type: alicloud:cms:DynamicTagGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DynamicTagGroupArgs
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 DynamicTagGroupArgs
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 DynamicTagGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DynamicTagGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DynamicTagGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DynamicTagGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DynamicTagGroup resource accepts the following input properties:

ContactGroupLists List<string>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

MatchExpresses List<Pulumi.AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs>

The label generates a matching expression that applies the grouping. See the following Block match_express.

TagKey string

The tag key of the tag.

MatchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

TemplateIdLists List<string>

Alarm template ID list.

ContactGroupLists []string

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

MatchExpresses []DynamicTagGroupMatchExpressArgs

The label generates a matching expression that applies the grouping. See the following Block match_express.

TagKey string

The tag key of the tag.

MatchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

TemplateIdLists []string

Alarm template ID list.

contactGroupLists List<String>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpresses List<DynamicTagGroupMatchExpressArgs>

The label generates a matching expression that applies the grouping. See the following Block match_express.

tagKey String

The tag key of the tag.

matchExpressFilterRelation String

The relationship between conditional expressions. Valid values: and, or.

templateIdLists List<String>

Alarm template ID list.

contactGroupLists string[]

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpresses DynamicTagGroupMatchExpressArgs[]

The label generates a matching expression that applies the grouping. See the following Block match_express.

tagKey string

The tag key of the tag.

matchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

templateIdLists string[]

Alarm template ID list.

contact_group_lists Sequence[str]

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

match_expresses Sequence[DynamicTagGroupMatchExpressArgs]

The label generates a matching expression that applies the grouping. See the following Block match_express.

tag_key str

The tag key of the tag.

match_express_filter_relation str

The relationship between conditional expressions. Valid values: and, or.

template_id_lists Sequence[str]

Alarm template ID list.

contactGroupLists List<String>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpresses List<Property Map>

The label generates a matching expression that applies the grouping. See the following Block match_express.

tagKey String

The tag key of the tag.

matchExpressFilterRelation String

The relationship between conditional expressions. Valid values: and, or.

templateIdLists List<String>

Alarm template ID list.

Outputs

All input properties are implicitly available as output properties. Additionally, the DynamicTagGroup resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource. Valid values: RUNNING, FINISH.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource. Valid values: RUNNING, FINISH.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource. Valid values: RUNNING, FINISH.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the resource. Valid values: RUNNING, FINISH.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the resource. Valid values: RUNNING, FINISH.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource. Valid values: RUNNING, FINISH.

Look up Existing DynamicTagGroup Resource

Get an existing DynamicTagGroup 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?: DynamicTagGroupState, opts?: CustomResourceOptions): DynamicTagGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        contact_group_lists: Optional[Sequence[str]] = None,
        match_express_filter_relation: Optional[str] = None,
        match_expresses: Optional[Sequence[DynamicTagGroupMatchExpressArgs]] = None,
        status: Optional[str] = None,
        tag_key: Optional[str] = None,
        template_id_lists: Optional[Sequence[str]] = None) -> DynamicTagGroup
func GetDynamicTagGroup(ctx *Context, name string, id IDInput, state *DynamicTagGroupState, opts ...ResourceOption) (*DynamicTagGroup, error)
public static DynamicTagGroup Get(string name, Input<string> id, DynamicTagGroupState? state, CustomResourceOptions? opts = null)
public static DynamicTagGroup get(String name, Output<String> id, DynamicTagGroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
ContactGroupLists List<string>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

MatchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

MatchExpresses List<Pulumi.AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs>

The label generates a matching expression that applies the grouping. See the following Block match_express.

Status string

The status of the resource. Valid values: RUNNING, FINISH.

TagKey string

The tag key of the tag.

TemplateIdLists List<string>

Alarm template ID list.

ContactGroupLists []string

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

MatchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

MatchExpresses []DynamicTagGroupMatchExpressArgs

The label generates a matching expression that applies the grouping. See the following Block match_express.

Status string

The status of the resource. Valid values: RUNNING, FINISH.

TagKey string

The tag key of the tag.

TemplateIdLists []string

Alarm template ID list.

contactGroupLists List<String>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpressFilterRelation String

The relationship between conditional expressions. Valid values: and, or.

matchExpresses List<DynamicTagGroupMatchExpressArgs>

The label generates a matching expression that applies the grouping. See the following Block match_express.

status String

The status of the resource. Valid values: RUNNING, FINISH.

tagKey String

The tag key of the tag.

templateIdLists List<String>

Alarm template ID list.

contactGroupLists string[]

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpressFilterRelation string

The relationship between conditional expressions. Valid values: and, or.

matchExpresses DynamicTagGroupMatchExpressArgs[]

The label generates a matching expression that applies the grouping. See the following Block match_express.

status string

The status of the resource. Valid values: RUNNING, FINISH.

tagKey string

The tag key of the tag.

templateIdLists string[]

Alarm template ID list.

contact_group_lists Sequence[str]

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

match_express_filter_relation str

The relationship between conditional expressions. Valid values: and, or.

match_expresses Sequence[DynamicTagGroupMatchExpressArgs]

The label generates a matching expression that applies the grouping. See the following Block match_express.

status str

The status of the resource. Valid values: RUNNING, FINISH.

tag_key str

The tag key of the tag.

template_id_lists Sequence[str]

Alarm template ID list.

contactGroupLists List<String>

Alarm contact group. The value range of N is 1~100. The alarm notification of the application group is sent to the alarm contact in the alarm contact group.

matchExpressFilterRelation String

The relationship between conditional expressions. Valid values: and, or.

matchExpresses List<Property Map>

The label generates a matching expression that applies the grouping. See the following Block match_express.

status String

The status of the resource. Valid values: RUNNING, FINISH.

tagKey String

The tag key of the tag.

templateIdLists List<String>

Alarm template ID list.

Supporting Types

DynamicTagGroupMatchExpress

TagValue string

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

TagValueMatchFunction string

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

TagValue string

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

TagValueMatchFunction string

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

tagValue String

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

tagValueMatchFunction String

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

tagValue string

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

tagValueMatchFunction string

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

tag_value str

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

tag_value_match_function str

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

tagValue String

The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.

tagValueMatchFunction String

Matching method of tag value. Valid values: all, startWith,endWith,contains,notContains,equals.

Import

Cloud Monitor Service Dynamic Tag Group can be imported using the id, e.g.

 $ pulumi import alicloud:cms/dynamicTagGroup:DynamicTagGroup example <id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.