1. Packages
  2. Alicloud Provider
  3. API Docs
  4. cms
  5. DynamicTagGroup
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.cms.DynamicTagGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    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",
        }],
    });
    
    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",
        }])
    
    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
    		}
    		_, 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
    	})
    }
    
    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",
                },
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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 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.

    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",
        },
    });
    
    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"),
    	},
    })
    
    var dynamicTagGroupResource = new DynamicTagGroup("dynamicTagGroupResource", DynamicTagGroupArgs.builder()
        .contactGroupLists("string")
        .matchExpresses(DynamicTagGroupMatchExpressArgs.builder()
            .tagValue("string")
            .tagValueMatchFunction("string")
            .build())
        .tagKey("string")
        .matchExpressFilterRelation("string")
        .templateIdLists("string")
        .build());
    
    dynamic_tag_group_resource = alicloud.cms.DynamicTagGroup("dynamicTagGroupResource",
        contact_group_lists=["string"],
        match_expresses=[alicloud.cms.DynamicTagGroupMatchExpressArgs(
            tag_value="string",
            tag_value_match_function="string",
        )],
        tag_key="string",
        match_express_filter_relation="string",
        template_id_lists=["string"])
    
    const dynamicTagGroupResource = new alicloud.cms.DynamicTagGroup("dynamicTagGroupResource", {
        contactGroupLists: ["string"],
        matchExpresses: [{
            tagValue: "string",
            tagValueMatchFunction: "string",
        }],
        tagKey: "string",
        matchExpressFilterRelation: "string",
        templateIdLists: ["string"],
    });
    
    type: alicloud:cms:DynamicTagGroup
    properties:
        contactGroupLists:
            - string
        matchExpressFilterRelation: string
        matchExpresses:
            - tagValue: string
              tagValueMatchFunction: string
        tagKey: string
        templateIdLists:
            - string
    

    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>
    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 List<Pulumi.AliCloud.Cms.Inputs.DynamicTagGroupMatchExpress>
    The conditional expressions used to create an application group based on the tag. See match_express below.
    TagKey string
    The tag keys of the cloud resources.
    MatchExpressFilterRelation string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    TemplateIdLists List<string>
    The IDs of the alert templates.
    ContactGroupLists []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 []DynamicTagGroupMatchExpressArgs
    The conditional expressions used to create an application group based on the tag. See match_express below.
    TagKey string
    The tag keys of the cloud resources.
    MatchExpressFilterRelation string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    TemplateIdLists []string
    The IDs of the alert templates.
    contactGroupLists 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 List<DynamicTagGroupMatchExpress>
    The conditional expressions used to create an application group based on the tag. See match_express below.
    tagKey String
    The tag keys of the cloud resources.
    matchExpressFilterRelation String
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    templateIdLists List<String>
    The IDs of the alert templates.
    contactGroupLists 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 DynamicTagGroupMatchExpress[]
    The conditional expressions used to create an application group based on the tag. See match_express below.
    tagKey string
    The tag keys of the cloud resources.
    matchExpressFilterRelation string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    templateIdLists string[]
    The IDs of the alert templates.
    contact_group_lists 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 Sequence[DynamicTagGroupMatchExpressArgs]
    The conditional expressions used to create an application group based on the tag. See match_express below.
    tag_key str
    The tag keys of the cloud resources.
    match_express_filter_relation str
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    template_id_lists Sequence[str]
    The IDs of the alert templates.
    contactGroupLists 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 List<Property Map>
    The conditional expressions used to create an application group based on the tag. See match_express below.
    tagKey String
    The tag keys of the cloud resources.
    matchExpressFilterRelation String
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    templateIdLists 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)
    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>
    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 string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    MatchExpresses 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 string
    The tag keys of the cloud resources.
    TemplateIdLists List<string>
    The IDs of the alert templates.
    ContactGroupLists []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 string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    MatchExpresses []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 string
    The tag keys of the cloud resources.
    TemplateIdLists []string
    The IDs of the alert templates.
    contactGroupLists 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 String
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    matchExpresses 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 String
    The tag keys of the cloud resources.
    templateIdLists List<String>
    The IDs of the alert templates.
    contactGroupLists 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 string
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    matchExpresses 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 string
    The tag keys of the cloud resources.
    templateIdLists string[]
    The IDs of the alert templates.
    contact_group_lists 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 str
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    match_expresses 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 str
    The tag keys of the cloud resources.
    template_id_lists Sequence[str]
    The IDs of the alert templates.
    contactGroupLists 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 String
    The relationship between the conditional expressions for the tag values of the cloud resources. Valid values: and, or.
    matchExpresses 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 String
    The tag keys of the cloud resources.
    templateIdLists List<String>
    The IDs of the alert templates.

    Supporting Types

    DynamicTagGroupMatchExpress, DynamicTagGroupMatchExpressArgs

    TagValue string
    The tag values of the cloud resources.
    TagValueMatchFunction string
    The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
    TagValue string
    The tag values of the cloud resources.
    TagValueMatchFunction string
    The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
    tagValue String
    The tag values of the cloud resources.
    tagValueMatchFunction String
    The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
    tagValue string
    The tag values of the cloud resources.
    tagValueMatchFunction 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 str
    The tag values of the cloud resources.
    tag_value_match_function str
    The method that is used to match the tag values of the cloud resources. Valid values: all, startWith, endWith, contains, notContains, equals.
    tagValue String
    The tag values of the cloud resources.
    tagValueMatchFunction 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>
    

    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.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi