1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cms
  5. DynamicTagGroup
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cms.DynamicTagGroup

Explore with Pulumi AI

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 since v1.142.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.cms.AlarmContactGroup("default", {alarmContactGroupName: name});
const defaultDynamicTagGroup = new alicloud.cms.DynamicTagGroup("default", {
    tagKey: name,
    contactGroupLists: [_default.id],
    matchExpresses: [{
        tagValue: name,
        tagValueMatchFunction: "all",
    }],
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = alicloud.cms.AlarmContactGroup("default", alarm_contact_group_name=name)
default_dynamic_tag_group = alicloud.cms.DynamicTagGroup("default",
    tag_key=name,
    contact_group_lists=[default.id],
    match_expresses=[{
        "tag_value": name,
        "tag_value_match_function": "all",
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := cms.NewAlarmContactGroup(ctx, "default", &cms.AlarmContactGroupArgs{
			AlarmContactGroupName: pulumi.String(name),
		})
		if err != nil {
			return err
		}
		_, err = cms.NewDynamicTagGroup(ctx, "default", &cms.DynamicTagGroupArgs{
			TagKey: pulumi.String(name),
			ContactGroupLists: pulumi.StringArray{
				_default.ID(),
			},
			MatchExpresses: cms.DynamicTagGroupMatchExpressArray{
				&cms.DynamicTagGroupMatchExpressArgs{
					TagValue:              pulumi.String(name),
					TagValueMatchFunction: pulumi.String("all"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var @default = new AliCloud.Cms.AlarmContactGroup("default", new()
    {
        AlarmContactGroupName = name,
    });

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

});
Copy
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        var default_ = new AlarmContactGroup("default", AlarmContactGroupArgs.builder()
            .alarmContactGroupName(name)
            .build());

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

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: alicloud:cms:AlarmContactGroup
    properties:
      alarmContactGroupName: ${name}
  defaultDynamicTagGroup:
    type: alicloud:cms:DynamicTagGroup
    name: default
    properties:
      tagKey: ${name}
      contactGroupLists:
        - ${default.id}
      matchExpresses:
        - tagValue: ${name}
          tagValueMatchFunction: all
Copy

Create DynamicTagGroup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DynamicTagGroup(name: string, args: DynamicTagGroupArgs, opts?: CustomResourceOptions);
@overload
def DynamicTagGroup(resource_name: str,
                    args: DynamicTagGroupArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def DynamicTagGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    contact_group_lists: Optional[Sequence[str]] = None,
                    match_expresses: Optional[Sequence[DynamicTagGroupMatchExpressArgs]] = None,
                    tag_key: Optional[str] = None,
                    match_express_filter_relation: Optional[str] = None,
                    template_id_lists: Optional[Sequence[str]] = 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.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var dynamicTagGroupResource = new AliCloud.Cms.DynamicTagGroup("dynamicTagGroupResource", new()
{
    ContactGroupLists = new[]
    {
        "string",
    },
    MatchExpresses = new[]
    {
        new AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs
        {
            TagValue = "string",
            TagValueMatchFunction = "string",
        },
    },
    TagKey = "string",
    MatchExpressFilterRelation = "string",
    TemplateIdLists = new[]
    {
        "string",
    },
});
Copy
example, err := cms.NewDynamicTagGroup(ctx, "dynamicTagGroupResource", &cms.DynamicTagGroupArgs{
	ContactGroupLists: pulumi.StringArray{
		pulumi.String("string"),
	},
	MatchExpresses: cms.DynamicTagGroupMatchExpressArray{
		&cms.DynamicTagGroupMatchExpressArgs{
			TagValue:              pulumi.String("string"),
			TagValueMatchFunction: pulumi.String("string"),
		},
	},
	TagKey:                     pulumi.String("string"),
	MatchExpressFilterRelation: pulumi.String("string"),
	TemplateIdLists: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var dynamicTagGroupResource = new DynamicTagGroup("dynamicTagGroupResource", DynamicTagGroupArgs.builder()
    .contactGroupLists("string")
    .matchExpresses(DynamicTagGroupMatchExpressArgs.builder()
        .tagValue("string")
        .tagValueMatchFunction("string")
        .build())
    .tagKey("string")
    .matchExpressFilterRelation("string")
    .templateIdLists("string")
    .build());
Copy
dynamic_tag_group_resource = alicloud.cms.DynamicTagGroup("dynamicTagGroupResource",
    contact_group_lists=["string"],
    match_expresses=[{
        "tag_value": "string",
        "tag_value_match_function": "string",
    }],
    tag_key="string",
    match_express_filter_relation="string",
    template_id_lists=["string"])
Copy
const dynamicTagGroupResource = new alicloud.cms.DynamicTagGroup("dynamicTagGroupResource", {
    contactGroupLists: ["string"],
    matchExpresses: [{
        tagValue: "string",
        tagValueMatchFunction: "string",
    }],
    tagKey: "string",
    matchExpressFilterRelation: "string",
    templateIdLists: ["string"],
});
Copy
type: alicloud:cms:DynamicTagGroup
properties:
    contactGroupLists:
        - string
    matchExpressFilterRelation: string
    matchExpresses:
        - tagValue: string
          tagValueMatchFunction: string
    tagKey: string
    templateIdLists:
        - string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The DynamicTagGroup resource accepts the following input properties:

ContactGroupLists
This property is required.
Changes to this property will trigger replacement.
List<string>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
MatchExpresses
This property is required.
Changes to this property will trigger replacement.
List<Pulumi.AliCloud.Cms.Inputs.DynamicTagGroupMatchExpress>
The conditional expressions used to create an application group based on the tag. See match_express below.
TagKey
This property is required.
Changes to this property will trigger replacement.
string
The tag keys of the cloud resources.
MatchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
TemplateIdLists Changes to this property will trigger replacement. List<string>
The IDs of the alert templates.
ContactGroupLists
This property is required.
Changes to this property will trigger replacement.
[]string
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
MatchExpresses
This property is required.
Changes to this property will trigger replacement.
[]DynamicTagGroupMatchExpressArgs
The conditional expressions used to create an application group based on the tag. See match_express below.
TagKey
This property is required.
Changes to this property will trigger replacement.
string
The tag keys of the cloud resources.
MatchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
TemplateIdLists Changes to this property will trigger replacement. []string
The IDs of the alert templates.
contactGroupLists
This property is required.
Changes to this property will trigger replacement.
List<String>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpresses
This property is required.
Changes to this property will trigger replacement.
List<DynamicTagGroupMatchExpress>
The conditional expressions used to create an application group based on the tag. See match_express below.
tagKey
This property is required.
Changes to this property will trigger replacement.
String
The tag keys of the cloud resources.
matchExpressFilterRelation Changes to this property will trigger replacement. String
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
templateIdLists Changes to this property will trigger replacement. List<String>
The IDs of the alert templates.
contactGroupLists
This property is required.
Changes to this property will trigger replacement.
string[]
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpresses
This property is required.
Changes to this property will trigger replacement.
DynamicTagGroupMatchExpress[]
The conditional expressions used to create an application group based on the tag. See match_express below.
tagKey
This property is required.
Changes to this property will trigger replacement.
string
The tag keys of the cloud resources.
matchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
templateIdLists Changes to this property will trigger replacement. string[]
The IDs of the alert templates.
contact_group_lists
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
match_expresses
This property is required.
Changes to this property will trigger replacement.
Sequence[DynamicTagGroupMatchExpressArgs]
The conditional expressions used to create an application group based on the tag. See match_express below.
tag_key
This property is required.
Changes to this property will trigger replacement.
str
The tag keys of the cloud resources.
match_express_filter_relation Changes to this property will trigger replacement. str
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
template_id_lists Changes to this property will trigger replacement. Sequence[str]
The IDs of the alert templates.
contactGroupLists
This property is required.
Changes to this property will trigger replacement.
List<String>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpresses
This property is required.
Changes to this property will trigger replacement.
List<Property Map>
The conditional expressions used to create an application group based on the tag. See match_express below.
tagKey
This property is required.
Changes to this property will trigger replacement.
String
The tag keys of the cloud resources.
matchExpressFilterRelation Changes to this property will trigger replacement. String
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
templateIdLists Changes to this property will trigger replacement. List<String>
The IDs of the alert templates.

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 Dynamic Tag Group.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the Dynamic Tag Group.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the Dynamic Tag Group.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the Dynamic Tag Group.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the Dynamic Tag Group.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the Dynamic Tag Group.

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)
resources:  _:    type: alicloud:cms:DynamicTagGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. List<string>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
MatchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
MatchExpresses Changes to this property will trigger replacement. List<Pulumi.AliCloud.Cms.Inputs.DynamicTagGroupMatchExpress>
The conditional expressions used to create an application group based on the tag. See match_express below.
Status string
The status of the Dynamic Tag Group.
TagKey Changes to this property will trigger replacement. string
The tag keys of the cloud resources.
TemplateIdLists Changes to this property will trigger replacement. List<string>
The IDs of the alert templates.
ContactGroupLists Changes to this property will trigger replacement. []string
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
MatchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
MatchExpresses Changes to this property will trigger replacement. []DynamicTagGroupMatchExpressArgs
The conditional expressions used to create an application group based on the tag. See match_express below.
Status string
The status of the Dynamic Tag Group.
TagKey Changes to this property will trigger replacement. string
The tag keys of the cloud resources.
TemplateIdLists Changes to this property will trigger replacement. []string
The IDs of the alert templates.
contactGroupLists Changes to this property will trigger replacement. List<String>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpressFilterRelation Changes to this property will trigger replacement. String
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
matchExpresses Changes to this property will trigger replacement. List<DynamicTagGroupMatchExpress>
The conditional expressions used to create an application group based on the tag. See match_express below.
status String
The status of the Dynamic Tag Group.
tagKey Changes to this property will trigger replacement. String
The tag keys of the cloud resources.
templateIdLists Changes to this property will trigger replacement. List<String>
The IDs of the alert templates.
contactGroupLists Changes to this property will trigger replacement. string[]
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpressFilterRelation Changes to this property will trigger replacement. string
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
matchExpresses Changes to this property will trigger replacement. DynamicTagGroupMatchExpress[]
The conditional expressions used to create an application group based on the tag. See match_express below.
status string
The status of the Dynamic Tag Group.
tagKey Changes to this property will trigger replacement. string
The tag keys of the cloud resources.
templateIdLists Changes to this property will trigger replacement. string[]
The IDs of the alert templates.
contact_group_lists Changes to this property will trigger replacement. Sequence[str]
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
match_express_filter_relation Changes to this property will trigger replacement. str
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
match_expresses Changes to this property will trigger replacement. Sequence[DynamicTagGroupMatchExpressArgs]
The conditional expressions used to create an application group based on the tag. See match_express below.
status str
The status of the Dynamic Tag Group.
tag_key Changes to this property will trigger replacement. str
The tag keys of the cloud resources.
template_id_lists Changes to this property will trigger replacement. Sequence[str]
The IDs of the alert templates.
contactGroupLists Changes to this property will trigger replacement. List<String>
The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.
matchExpressFilterRelation Changes to this property will trigger replacement. String
The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
matchExpresses Changes to this property will trigger replacement. List<Property Map>
The conditional expressions used to create an application group based on the tag. See match_express below.
status String
The status of the Dynamic Tag Group.
tagKey Changes to this property will trigger replacement. String
The tag keys of the cloud resources.
templateIdLists Changes to this property will trigger replacement. List<String>
The IDs of the alert templates.

Supporting Types

DynamicTagGroupMatchExpress
, DynamicTagGroupMatchExpressArgs

TagValue
This property is required.
Changes to this property will trigger replacement.
string
The tag values of the cloud resources.
TagValueMatchFunction
This property is required.
Changes to this property will trigger replacement.
string
The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
TagValue
This property is required.
Changes to this property will trigger replacement.
string
The tag values of the cloud resources.
TagValueMatchFunction
This property is required.
Changes to this property will trigger replacement.
string
The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
tagValue
This property is required.
Changes to this property will trigger replacement.
String
The tag values of the cloud resources.
tagValueMatchFunction
This property is required.
Changes to this property will trigger replacement.
String
The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
tagValue
This property is required.
Changes to this property will trigger replacement.
string
The tag values of the cloud resources.
tagValueMatchFunction
This property is required.
Changes to this property will trigger replacement.
string
The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
tag_value
This property is required.
Changes to this property will trigger replacement.
str
The tag values of the cloud resources.
tag_value_match_function
This property is required.
Changes to this property will trigger replacement.
str
The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
tagValue
This property is required.
Changes to this property will trigger replacement.
String
The tag values of the cloud resources.
tagValueMatchFunction
This property is required.
Changes to this property will trigger replacement.
String
The method that is used to match the tag values of the cloud resources. 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>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.