@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:39.538Z") public class CfnGroup extends CfnResource implements IInspectable
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 AWS Resource Groups in the AWS Resource Groups User Guide . For more information about service-linked groups and service configurations, see Service configurations for Resource Groups .
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:CreateGroup
Example:
// 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.*; CfnGroup cfnGroup = CfnGroup.Builder.create(this, "MyCfnGroup") .name("name") // the properties below are optional .configuration(List.of(ConfigurationItemProperty.builder() .parameters(List.of(ConfigurationParameterProperty.builder() .name("name") .values(List.of("values")) .build())) .type("type") .build())) .description("description") .resourceQuery(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()) .resources(List.of("resources")) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnGroup.Builder
A fluent builder for
CfnGroup . |
static interface |
CfnGroup.ConfigurationItemProperty
One of the items in the service configuration assigned to a resource group.
|
static interface |
CfnGroup.ConfigurationParameterProperty
One parameter for a group configuration item.
|
static interface |
CfnGroup.QueryProperty
Specifies details within a `ResourceQuery` structure that determines the membership of the resource group.
|
static interface |
CfnGroup.ResourceQueryProperty
The query used to dynamically define the members of a group.
|
static interface |
CfnGroup.TagFilterProperty
Specifies a single tag key and optional values that you can use to specify membership in a tag-based group.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnGroup(Construct scope,
java.lang.String id,
CfnGroupProps props)
Create a new `AWS::ResourceGroups::Group`.
|
protected |
CfnGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnGroup(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The ARN of the new resource group.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getConfiguration()
The service configuration currently associated with the resource group and in effect for the members of the resource group.
|
java.lang.String |
getDescription()
The description of the resource group.
|
java.lang.String |
getName()
The name of a resource group.
|
java.lang.Object |
getResourceQuery()
The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
|
java.util.List<java.lang.String> |
getResources()
A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.
|
TagManager |
getTags()
The tag key and value pairs that are attached to the resource group.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setConfiguration(IResolvable value)
The service configuration currently associated with the resource group and in effect for the members of the resource group.
|
void |
setConfiguration(java.util.List<java.lang.Object> value)
The service configuration currently associated with the resource group and in effect for the members of the resource group.
|
void |
setDescription(java.lang.String value)
The description of the resource group.
|
void |
setName(java.lang.String value)
The name of a resource group.
|
void |
setResourceQuery(CfnGroup.ResourceQueryProperty value)
The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
|
void |
setResourceQuery(IResolvable value)
The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
|
void |
setResources(java.util.List<java.lang.String> value)
A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnGroup(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnGroup(Construct scope, java.lang.String id, CfnGroupProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getName()
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.
public void setName(java.lang.String value)
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.
public java.lang.Object getConfiguration()
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 in the AWS Resource Groups User Guide .
You can include either a
Configuration
or aResourceQuery
, but not both.
public void setConfiguration(IResolvable value)
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 in the AWS Resource Groups User Guide .
You can include either a
Configuration
or aResourceQuery
, but not both.
public void setConfiguration(java.util.List<java.lang.Object> value)
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 in the AWS Resource Groups User Guide .
You can include either a
Configuration
or aResourceQuery
, but not both.
public java.lang.String getDescription()
public void setDescription(java.lang.String value)
public java.lang.Object getResourceQuery()
For more information about queries and how to construct them, see Build queries and groups in AWS Resource Groups in the AWS Resource Groups User Guide
- You can include either a
ResourceQuery
or aConfiguration
, but not both.- You can specify the group's membership either by using a
ResourceQuery
or by using a list ofResources
, but not both.
public void setResourceQuery(IResolvable value)
For more information about queries and how to construct them, see Build queries and groups in AWS Resource Groups in the AWS Resource Groups User Guide
- You can include either a
ResourceQuery
or aConfiguration
, but not both.- You can specify the group's membership either by using a
ResourceQuery
or by using a list ofResources
, but not both.
public void setResourceQuery(CfnGroup.ResourceQueryProperty value)
For more information about queries and how to construct them, see Build queries and groups in AWS Resource Groups in the AWS Resource Groups User Guide
- You can include either a
ResourceQuery
or aConfiguration
, but not both.- You can specify the group's membership either by using a
ResourceQuery
or by using a list ofResources
, but not both.
public java.util.List<java.lang.String> getResources()
- You can specify the group membership either by using a list of
Resources
or by using aResourceQuery
, but not both.- You can include a
Resources
property only if you also specify aConfiguration
property.
public void setResources(java.util.List<java.lang.String> value)
- You can specify the group membership either by using a list of
Resources
or by using aResourceQuery
, but not both.- You can include a
Resources
property only if you also specify aConfiguration
property.