ResourceQueryProperty Struct
The query used to dynamically define the members of a group.
For more information about how to construct a query, see Build queries and groups in Resource Groups .
| Source | |
|---|---|
| Type last changed |
Example
ts
// 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 resourceQueryProperty: resourcegroups.CfnGroup.ResourceQueryProperty = {
query: {
resourceTypeFilters: ['resourceTypeFilters'],
stackIdentifier: 'stackIdentifier',
tagFilters: [{
key: 'key',
values: ['values'],
}],
},
type: 'type',
};
python
# 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
resource_query_property = resourcegroups.CfnGroup.ResourceQueryProperty(
query=resourcegroups.CfnGroup.QueryProperty(
resource_type_filters=["resourceTypeFilters"],
stack_identifier="stackIdentifier",
tag_filters=[resourcegroups.CfnGroup.TagFilterProperty(
key="key",
values=["values"]
)]
),
type="type"
)
java
// 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.*;
ResourceQueryProperty resourceQueryProperty = ResourceQueryProperty.builder()
.query(QueryProperty.builder()
.resourceTypeFilters(List.of("resourceTypeFilters"))
.stackIdentifier("stackIdentifier")
.tagFilters(List.of(TagFilterProperty.builder()
.key("key")
.values(List.of("values"))
.build()))
.build())
.type("type")
.build();
csharp
// 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 resourceQueryProperty = new ResourceQueryProperty {
Query = new QueryProperty {
ResourceTypeFilters = new [] { "resourceTypeFilters" },
StackIdentifier = "stackIdentifier",
TagFilters = new [] { new TagFilterProperty {
Key = "key",
Values = new [] { "values" }
} }
},
Type = "type"
};
go
// 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"
resourceQueryProperty := &ResourceQueryProperty{
Query: &QueryProperty{
ResourceTypeFilters: []*string{
jsii.String("resourceTypeFilters"),
},
StackIdentifier: jsii.String("stackIdentifier"),
TagFilters: []interface{}{
&TagFilterProperty{
Key: jsii.String("key"),
Values: []*string{
jsii.String("values"),
},
},
},
},
Type: jsii.String("type"),
}
Properties
queryoptionalIResolvable | CfnGroup.QueryPropertyqueryoptionaltyping.Union[IResolvable, QueryProperty]queryoptionalIResolvableQueryoptionalIResolvableQueryoptionalinterface{} #The query that defines the membership of the group.
notes
This is a structure with properties that depend on the Type .
The Query structure must be included in the following scenarios:
- When the
TypeisTAG_FILTERS_1_0, you must specify aQuerystructure that contains aTagFilterslist of tags. Resources with tags that match those in theTagFilterlist become members of the resource group. - When the
TypeisCLOUDFORMATION_STACK_1_0then this field is required only when you must specify a CloudFormation stack other than the one you are defining. To do this, theQuerystructure must contain theStackIdentifierproperty. If you don't specify either aQuerystructure or aStackIdentifierwithin thatQuery, then it defaults to the CloudFormation stack that you're currently constructing.
Specifies the type of resource query that determines this group's membership. There are two valid query types:.
notes
TAG_FILTERS_1_0indicates that the group is a tag-based group. To complete the group membership, you must include theTagFiltersproperty to specify the tag filters to use in the query.CLOUDFORMATION_STACK_1_0, the default, indicates that the group is a CloudFormation stack-based group. Group membership is based on the CloudFormation stack. You must specify theStackIdentifierproperty in the query to define which stack to associate the group with, or leave it empty to default to the stack where the group is defined.