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",
}],
});
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
}
_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
})
}
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
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",
},
});
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=[{
"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
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:
- Contact
Group Lists This property is required. Changes to this property will trigger replacement.
- 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.
Ali Cloud. Cms. Inputs. Dynamic Tag Group Match Express> - 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.
- The tag keys of the cloud resources.
- Match
Express Filter Relation Changes to this property will trigger replacement.
- 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.
- The IDs of the alert templates.
- Contact
Group Lists This property is required. Changes to this property will trigger replacement.
- 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.
Tag Group Match Express Args - 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.
- The tag keys of the cloud resources.
- Match
Express Filter Relation Changes to this property will trigger replacement.
- 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.
- The IDs of the alert templates.
- contact
Group Lists This property is required. Changes to this property will trigger replacement.
- 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.
Tag Group Match Express> - 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.
- The tag keys of the cloud resources.
- match
Express Filter Relation Changes to this property will trigger replacement.
- 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.
- The IDs of the alert templates.
- contact
Group Lists This property is required. Changes to this property will trigger replacement.
- 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.
Tag Group Match Express[] - 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.
- The tag keys of the cloud resources.
- match
Express Filter Relation Changes to this property will trigger replacement.
- 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.
- The IDs of the alert templates.
- contact_
group_ lists This property is required. Changes to this property will trigger replacement.
- 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.
Tag Group Match Express Args] - 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.
- The tag keys of the cloud resources.
- match_
express_ filter_ relation Changes to this property will trigger replacement.
- 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.
- The IDs of the alert templates.
- contact
Group Lists This property is required. Changes to this property will trigger replacement.
- 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.
- 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.
- The tag keys of the cloud resources.
- match
Express Filter Relation Changes to this property will trigger replacement.
- 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.
- 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:
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.
- Contact
Group Lists Changes to this property will trigger replacement.
- 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.
- 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.
Ali Cloud. Cms. Inputs. Dynamic Tag Group Match Express> - 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.
- Tag
Key Changes to this property will trigger replacement.
- The tag keys of the cloud resources.
- Template
Id Lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
- Contact
Group Lists Changes to this property will trigger replacement.
- 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.
- 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.
Tag Group Match Express Args - 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.
- Tag
Key Changes to this property will trigger replacement.
- The tag keys of the cloud resources.
- Template
Id Lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
- contact
Group Lists Changes to this property will trigger replacement.
- 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.
- 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.
Tag Group Match Express> - 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.
- tag
Key Changes to this property will trigger replacement.
- The tag keys of the cloud resources.
- template
Id Lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
- contact
Group Lists Changes to this property will trigger replacement.
- 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.
- 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.
Tag Group Match Express[] - 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.
- tag
Key Changes to this property will trigger replacement.
- The tag keys of the cloud resources.
- template
Id Lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
- contact_
group_ lists Changes to this property will trigger replacement.
- 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.
- 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.
Tag Group Match Express Args] - 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.
- The tag keys of the cloud resources.
- template_
id_ lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
- contact
Group Lists Changes to this property will trigger replacement.
- 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.
- 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.
- 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.
- tag
Key Changes to this property will trigger replacement.
- The tag keys of the cloud resources.
- template
Id Lists Changes to this property will trigger replacement.
- The IDs of the alert templates.
Supporting Types
DynamicTagGroupMatchExpress, DynamicTagGroupMatchExpressArgs
- Tag
Value This property is required. Changes to this property will trigger replacement.
- The tag values of the cloud resources.
- Tag
Value Match Function This property is required. Changes to this property will trigger replacement.
- 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.
- The tag values of the cloud resources.
- Tag
Value Match Function This property is required. Changes to this property will trigger replacement.
- 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.
- The tag values of the cloud resources.
- tag
Value Match Function This property is required. Changes to this property will trigger replacement.
- 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.
- The tag values of the cloud resources.
- tag
Value Match Function This property is required. Changes to this property will trigger replacement.
- 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.
- The tag values of the cloud resources.
- tag_
value_ match_ function This property is required. Changes to this property will trigger replacement.
- 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.
- The tag values of the cloud resources.
- tag
Value Match Function This property is required. Changes to this property will trigger replacement.
- 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.