AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ResourceGroups::Group

CfnGroup

Creates a resource group with the specified name and description. You can optionally include either a resource query or a service configuration. For more information about constructing a resource query, see [Build queries and groups in Resource Groups](https://docs.aws.amazon.com//ARG/latest/userguide/getting_started-query.html) in the *Resource Groups User Guide* . For more information about service-linked groups and service configurations, see [Service configurations for Resource Groups](https://docs.aws.amazon.com//ARG/latest/APIReference/about-slg.html) . *Minimum permissions* To run this command, you must have the following permissions: - `resource-groups:CreateGroup`

Import

import { CfnGroup } from 'aws-cdk-lib/aws-resourcegroups';

Or use the module namespace:

import * as resourcegroups from 'aws-cdk-lib/aws-resourcegroups';
// resourcegroups.CfnGroup

Properties

Configuration passed to the constructor as CfnGroupProps.

nameRequired
string

The name of a resource group. The name must be unique within the AWS Region in which you create the resource. To create multiple resource groups based on the same CloudFormation stack, you must generate unique names for each.

configurationOptional
IResolvable | IResolvable | ConfigurationItemProperty[]

The service configuration currently associated with the resource group and in effect for the members of the resource group. A `Configuration` consists of one or more `ConfigurationItem` entries. For information about service configurations for resource groups and how to construct them, see [Service configurations for resource groups](https://docs.aws.amazon.com//ARG/latest/APIReference/about-slg.html) in the *Resource Groups User Guide* . > You can include either a `Configuration` or a `ResourceQuery` , but not both.

descriptionOptional
string

The description of the resource group.

resourceQueryOptional
IResolvable | ResourceQueryProperty

The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group. For more information about queries and how to construct them, see [Build queries and groups in Resource Groups](https://docs.aws.amazon.com//ARG/latest/userguide/gettingstarted-query.html) in the *Resource Groups User Guide* > - You can include either a `ResourceQuery` or a `Configuration` , but not both. > - You can specify the group's membership either by using a `ResourceQuery` or by using a list of `Resources` , but not both.

resourcesOptional
string[]

A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group. > - You can specify the group membership either by using a list of `Resources` or by using a `ResourceQuery` , but not both. > - You can include a `Resources` property only if you also specify a `Configuration` property.

tagsOptional
CfnTag[]

The tag key and value pairs that are attached to the resource group.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-resourcegroups
CFN TypeAWS::ResourceGroups::Group
Properties6

Related Constructs

External Links