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
}
_, 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=[{
"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 List<string>Lists - 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 List<Pulumi.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 string - The tag keys of the cloud resources.
- Match
Express stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - Template
Id List<string>Lists - The IDs of the alert templates.
- Contact
Group []stringLists - 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 []DynamicTag Group Match Express Args - The conditional expressions used to create an application group based on the tag. See
match_express
below. - Tag
Key string - The tag keys of the cloud resources.
- Match
Express stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - Template
Id []stringLists - The IDs of the alert templates.
- contact
Group List<String>Lists - 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 List<DynamicTag Group Match Express> - The conditional expressions used to create an application group based on the tag. See
match_express
below. - tag
Key String - The tag keys of the cloud resources.
- match
Express StringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - template
Id List<String>Lists - The IDs of the alert templates.
- contact
Group string[]Lists - 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 DynamicTag Group Match Express[] - The conditional expressions used to create an application group based on the tag. See
match_express
below. - tag
Key string - The tag keys of the cloud resources.
- match
Express stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - template
Id string[]Lists - The IDs of the alert templates.
- contact_
group_ Sequence[str]lists - 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[DynamicTag Group Match Express Args] - 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_ strfilter_ relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - template_
id_ Sequence[str]lists - The IDs of the alert templates.
- contact
Group List<String>Lists - 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 List<Property Map> - The conditional expressions used to create an application group based on the tag. See
match_express
below. - tag
Key String - The tag keys of the cloud resources.
- match
Express StringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - template
Id List<String>Lists - 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)
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.
- Contact
Group List<string>Lists - 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 stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - Match
Expresses List<Pulumi.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 string - The tag keys of the cloud resources.
- Template
Id List<string>Lists - The IDs of the alert templates.
- Contact
Group []stringLists - 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 stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - Match
Expresses []DynamicTag 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 string - The tag keys of the cloud resources.
- Template
Id []stringLists - The IDs of the alert templates.
- contact
Group List<String>Lists - 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 StringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - match
Expresses List<DynamicTag 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 String - The tag keys of the cloud resources.
- template
Id List<String>Lists - The IDs of the alert templates.
- contact
Group string[]Lists - 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 stringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - match
Expresses DynamicTag 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 string - The tag keys of the cloud resources.
- template
Id string[]Lists - The IDs of the alert templates.
- contact_
group_ Sequence[str]lists - 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_ strfilter_ relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - match_
expresses Sequence[DynamicTag 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 str - The tag keys of the cloud resources.
- template_
id_ Sequence[str]lists - The IDs of the alert templates.
- contact
Group List<String>Lists - 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 StringFilter Relation - The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:
and
,or
. - match
Expresses 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.
- tag
Key String - The tag keys of the cloud resources.
- template
Id List<String>Lists - The IDs of the alert templates.
Supporting Types
DynamicTagGroupMatchExpress, DynamicTagGroupMatchExpressArgs
- Tag
Value string - The tag values of the cloud resources.
- Tag
Value stringMatch Function - The method that is used to match the tag values of the cloud resources. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- Tag
Value string - The tag values of the cloud resources.
- Tag
Value stringMatch Function - The method that is used to match the tag values of the cloud resources. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value String - The tag values of the cloud resources.
- tag
Value StringMatch Function - The method that is used to match the tag values of the cloud resources. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value string - The tag values of the cloud resources.
- tag
Value stringMatch Function - 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_ strmatch_ function - The method that is used to match the tag values of the cloud resources. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value String - The tag values of the cloud resources.
- tag
Value StringMatch Function - 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.