Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cms.getDynamicTagGroups
Explore with Pulumi AI
This data source provides the Cms Dynamic Tag Groups of the current Alibaba Cloud user.
NOTE: Available in 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") || "example_value";
const _default = new alicloud.cms.AlarmContactGroup("default", {
alarmContactGroupName: name,
describe: "example_value",
enableSubscribed: true,
});
const defaultDynamicTagGroup = new alicloud.cms.DynamicTagGroup("default", {
contactGroupLists: [_default.id],
tagKey: "your_tag_key",
matchExpresses: [{
tagValue: "your_tag_value",
tagValueMatchFunction: "all",
}],
});
const ids = alicloud.cms.getDynamicTagGroupsOutput({
ids: [defaultDynamicTagGroup.id],
});
export const cmsDynamicTagGroupId1 = ids.apply(ids => ids.groups?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "example_value"
default = alicloud.cms.AlarmContactGroup("default",
alarm_contact_group_name=name,
describe="example_value",
enable_subscribed=True)
default_dynamic_tag_group = alicloud.cms.DynamicTagGroup("default",
contact_group_lists=[default.id],
tag_key="your_tag_key",
match_expresses=[{
"tag_value": "your_tag_value",
"tag_value_match_function": "all",
}])
ids = alicloud.cms.get_dynamic_tag_groups_output(ids=[default_dynamic_tag_group.id])
pulumi.export("cmsDynamicTagGroupId1", ids.groups[0].id)
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 := "example_value"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := cms.NewAlarmContactGroup(ctx, "default", &cms.AlarmContactGroupArgs{
AlarmContactGroupName: pulumi.String(name),
Describe: pulumi.String("example_value"),
EnableSubscribed: pulumi.Bool(true),
})
if err != nil {
return err
}
defaultDynamicTagGroup, err := cms.NewDynamicTagGroup(ctx, "default", &cms.DynamicTagGroupArgs{
ContactGroupLists: pulumi.StringArray{
_default.ID(),
},
TagKey: pulumi.String("your_tag_key"),
MatchExpresses: cms.DynamicTagGroupMatchExpressArray{
&cms.DynamicTagGroupMatchExpressArgs{
TagValue: pulumi.String("your_tag_value"),
TagValueMatchFunction: pulumi.String("all"),
},
},
})
if err != nil {
return err
}
ids := cms.GetDynamicTagGroupsOutput(ctx, cms.GetDynamicTagGroupsOutputArgs{
Ids: pulumi.StringArray{
defaultDynamicTagGroup.ID(),
},
}, nil)
ctx.Export("cmsDynamicTagGroupId1", ids.ApplyT(func(ids cms.GetDynamicTagGroupsResult) (*string, error) {
return &ids.Groups[0].Id, nil
}).(pulumi.StringPtrOutput))
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") ?? "example_value";
var @default = new AliCloud.Cms.AlarmContactGroup("default", new()
{
AlarmContactGroupName = name,
Describe = "example_value",
EnableSubscribed = true,
});
var defaultDynamicTagGroup = new AliCloud.Cms.DynamicTagGroup("default", new()
{
ContactGroupLists = new[]
{
@default.Id,
},
TagKey = "your_tag_key",
MatchExpresses = new[]
{
new AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs
{
TagValue = "your_tag_value",
TagValueMatchFunction = "all",
},
},
});
var ids = AliCloud.Cms.GetDynamicTagGroups.Invoke(new()
{
Ids = new[]
{
defaultDynamicTagGroup.Id,
},
});
return new Dictionary<string, object?>
{
["cmsDynamicTagGroupId1"] = ids.Apply(getDynamicTagGroupsResult => getDynamicTagGroupsResult.Groups[0]?.Id),
};
});
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 com.pulumi.alicloud.cms.CmsFunctions;
import com.pulumi.alicloud.cms.inputs.GetDynamicTagGroupsArgs;
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("example_value");
var default_ = new AlarmContactGroup("default", AlarmContactGroupArgs.builder()
.alarmContactGroupName(name)
.describe("example_value")
.enableSubscribed(true)
.build());
var defaultDynamicTagGroup = new DynamicTagGroup("defaultDynamicTagGroup", DynamicTagGroupArgs.builder()
.contactGroupLists(default_.id())
.tagKey("your_tag_key")
.matchExpresses(DynamicTagGroupMatchExpressArgs.builder()
.tagValue("your_tag_value")
.tagValueMatchFunction("all")
.build())
.build());
final var ids = CmsFunctions.getDynamicTagGroups(GetDynamicTagGroupsArgs.builder()
.ids(defaultDynamicTagGroup.id())
.build());
ctx.export("cmsDynamicTagGroupId1", ids.applyValue(getDynamicTagGroupsResult -> getDynamicTagGroupsResult).applyValue(ids -> ids.applyValue(getDynamicTagGroupsResult -> getDynamicTagGroupsResult.groups()[0].id())));
}
}
configuration:
name:
type: string
default: example_value
resources:
default:
type: alicloud:cms:AlarmContactGroup
properties:
alarmContactGroupName: ${name}
describe: example_value
enableSubscribed: true
defaultDynamicTagGroup:
type: alicloud:cms:DynamicTagGroup
name: default
properties:
contactGroupLists:
- ${default.id}
tagKey: your_tag_key
matchExpresses:
- tagValue: your_tag_value
tagValueMatchFunction: all
variables:
ids:
fn::invoke:
Function: alicloud:cms:getDynamicTagGroups
Arguments:
ids:
- ${defaultDynamicTagGroup.id}
outputs:
cmsDynamicTagGroupId1: ${ids.groups[0].id}
Using getDynamicTagGroups
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDynamicTagGroups(args: GetDynamicTagGroupsArgs, opts?: InvokeOptions): Promise<GetDynamicTagGroupsResult>
function getDynamicTagGroupsOutput(args: GetDynamicTagGroupsOutputArgs, opts?: InvokeOptions): Output<GetDynamicTagGroupsResult>
def get_dynamic_tag_groups(ids: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
tag_key: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDynamicTagGroupsResult
def get_dynamic_tag_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
tag_key: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDynamicTagGroupsResult]
func GetDynamicTagGroups(ctx *Context, args *GetDynamicTagGroupsArgs, opts ...InvokeOption) (*GetDynamicTagGroupsResult, error)
func GetDynamicTagGroupsOutput(ctx *Context, args *GetDynamicTagGroupsOutputArgs, opts ...InvokeOption) GetDynamicTagGroupsResultOutput
> Note: This function is named GetDynamicTagGroups
in the Go SDK.
public static class GetDynamicTagGroups
{
public static Task<GetDynamicTagGroupsResult> InvokeAsync(GetDynamicTagGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetDynamicTagGroupsResult> Invoke(GetDynamicTagGroupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDynamicTagGroupsResult> getDynamicTagGroups(GetDynamicTagGroupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cms/getDynamicTagGroups:getDynamicTagGroups
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Dynamic Tag Group IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - Tag
Key string - The tag key of the tag.
- Ids []string
- A list of Dynamic Tag Group IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - Tag
Key string - The tag key of the tag.
- ids List<String>
- A list of Dynamic Tag Group IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key String - The tag key of the tag.
- ids string[]
- A list of Dynamic Tag Group IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key string - The tag key of the tag.
- ids Sequence[str]
- A list of Dynamic Tag Group IDs.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - status str
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag_
key str - The tag key of the tag.
- ids List<String>
- A list of Dynamic Tag Group IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key String - The tag key of the tag.
getDynamicTagGroups Result
The following output properties are available:
- Groups
List<Pulumi.
Ali Cloud. Cms. Outputs. Get Dynamic Tag Groups Group> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Output
File string - Status string
- Tag
Key string
- Groups
[]Get
Dynamic Tag Groups Group - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Output
File string - Status string
- Tag
Key string
- groups
List<Get
Dynamic Tag Groups Group> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- output
File String - status String
- tag
Key String
- groups
Get
Dynamic Tag Groups Group[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- output
File string - status string
- tag
Key string
- groups
Sequence[Get
Dynamic Tag Groups Group] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- output_
file str - status str
- tag_
key str
- groups List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- output
File String - status String
- tag
Key String
Supporting Types
GetDynamicTagGroupsGroup
- Dynamic
Tag stringRule Id - The ID of the tag rule.
- Id string
- The ID of the Dynamic Tag Group.
- Match
Express stringFilter Relation - The relationship between conditional expressions. Valid values:
and
,or
. - Match
Expresses List<Pulumi.Ali Cloud. Cms. Inputs. Get Dynamic Tag Groups Group Match Express> - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - Status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - Tag
Key string - The tag key of the tag.
- Dynamic
Tag stringRule Id - The ID of the tag rule.
- Id string
- The ID of the Dynamic Tag Group.
- Match
Express stringFilter Relation - The relationship between conditional expressions. Valid values:
and
,or
. - Match
Expresses []GetDynamic Tag Groups Group Match Express - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - Status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - Tag
Key string - The tag key of the tag.
- dynamic
Tag StringRule Id - The ID of the tag rule.
- id String
- The ID of the Dynamic Tag Group.
- match
Express StringFilter Relation - The relationship between conditional expressions. Valid values:
and
,or
. - match
Expresses List<GetDynamic Tag Groups Group Match Express> - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - status String
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key String - The tag key of the tag.
- dynamic
Tag stringRule Id - The ID of the tag rule.
- id string
- The ID of the Dynamic Tag Group.
- match
Express stringFilter Relation - The relationship between conditional expressions. Valid values:
and
,or
. - match
Expresses GetDynamic Tag Groups Group Match Express[] - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - status string
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key string - The tag key of the tag.
- dynamic_
tag_ strrule_ id - The ID of the tag rule.
- id str
- The ID of the Dynamic Tag Group.
- match_
express_ strfilter_ relation - The relationship between conditional expressions. Valid values:
and
,or
. - match_
expresses Sequence[GetDynamic Tag Groups Group Match Express] - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - status str
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag_
key str - The tag key of the tag.
- dynamic
Tag StringRule Id - The ID of the tag rule.
- id String
- The ID of the Dynamic Tag Group.
- match
Express StringFilter Relation - The relationship between conditional expressions. Valid values:
and
,or
. - match
Expresses List<Property Map> - The label generates a matching expression that applies the grouping. See the following
Block match_express
. - status String
- The status of the resource. Valid values:
RUNNING
,FINISH
. - tag
Key String - The tag key of the tag.
GetDynamicTagGroupsGroupMatchExpress
- Tag
Value string - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- Tag
Value stringMatch Function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- Tag
Value string - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- Tag
Value stringMatch Function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value String - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- tag
Value StringMatch Function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value string - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- tag
Value stringMatch Function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag_
value str - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- tag_
value_ strmatch_ function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
- tag
Value String - The tag value. The Tag value must be used in conjunction with the tag value matching method TagValueMatchFunction.
- tag
Value StringMatch Function - Matching method of tag value. Valid values:
all
,startWith
,endWith
,contains
,notContains
,equals
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.