TagFilterProperty Struct
Specifies a single tag key and optional values that you can use to specify membership in a tag-based group.
An AWS resource that doesn't have a matching tag key and value is rejected as a member of the group.
A TagFilter object includes two properties: Key (a string) and Values (a list of strings). Only resources in the account that are tagged with a matching key-value pair are members of the group. The Values property of TagFilter is optional, but specifying it narrows the query results.
As an example, suppose the TagFilters string is [{"Key": "Stage", "Values": ["Test", "Beta"]}, {"Key": "Storage"}] . In this case, only resources with all of the following tags are members of the group:
Stagetag key with a value of eitherTestorBetaStoragetag key with any value
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_resourcegroups as resourcegroups } from 'aws-cdk-lib';
const tagFilterProperty: resourcegroups.CfnGroup.TagFilterProperty = {
key: 'key',
values: ['values'],
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_resourcegroups as resourcegroups
tag_filter_property = resourcegroups.CfnGroup.TagFilterProperty(
key="key",
values=["values"]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.resourcegroups.*;
TagFilterProperty tagFilterProperty = TagFilterProperty.builder()
.key("key")
.values(List.of("values"))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ResourceGroups;
var tagFilterProperty = new TagFilterProperty {
Key = "key",
Values = new [] { "values" }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
tagFilterProperty := &TagFilterProperty{
Key: jsii.String("key"),
Values: []*string{
jsii.String("values"),
},
}
Properties
notes
Only resources in the account that are tagged with a specified tag key are members of the tag-based resource group.
This field is required when the ResourceQuery structure's Type property is TAG_FILTERS_1_0 . You must specify at least one tag key.
valuesoptionalstring[]valuesoptionaltyping.List[str]valuesoptionalList<String>Valuesoptionalstring[]Valuesoptional*[]*string#This is optional. If you don't specify a value or values for a key, then an AWS resource with any value for that key is a member.