java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:12.877Z") @Stability(Stable) public class CfnGroup extends CfnResource implements IInspectable, ITaggable
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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnGroup

      protected CfnGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnGroup

      protected CfnGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnGroup

      @Stability(Stable) public CfnGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnGroupProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the new resource group.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of a resource group.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of a resource group.
    • getConfiguration

      @Stability(Stable) @Nullable public Object getConfiguration()
      The service configuration currently associated with the resource group and in effect for the members of the resource group.
    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable IResolvable value)
      The service configuration currently associated with the resource group and in effect for the members of the resource group.
    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable List<Object> value)
      The service configuration currently associated with the resource group and in effect for the members of the resource group.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the resource group.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the resource group.
    • getResourceQuery

      @Stability(Stable) @Nullable public Object getResourceQuery()
      The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
    • setResourceQuery

      @Stability(Stable) public void setResourceQuery(@Nullable IResolvable value)
      The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
    • setResourceQuery

      @Stability(Stable) public void setResourceQuery(@Nullable CfnGroup.ResourceQueryProperty value)
      The resource query structure that is used to dynamically determine which AWS resources are members of the associated resource group.
    • getResources

      @Stability(Stable) @Nullable public List<String> getResources()
      A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.
    • setResources

      @Stability(Stable) public void setResources(@Nullable List<String> value)
      A list of the Amazon Resource Names (ARNs) of AWS resources that you want to add to the specified group.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tag key and value pairs that are attached to the resource group.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tag key and value pairs that are attached to the resource group.