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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:34.979Z") @Stability(Stable) public class CfnGroup extends CfnResource implements IInspectable
A CloudFormation AWS::ResourceGroups::Group.

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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnGroupProps props)
      Create a new AWS::ResourceGroups::Group.

      Parameters:
      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.
  • 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()
      The tag key and value pairs that are attached to the resource group.
    • getName

      @Stability(Stable) @NotNull public String getName()
      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.

    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      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.

    • 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.

      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 a ResourceQuery , but not both.

    • 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.

      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 a ResourceQuery , but not both.

    • 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.

      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 a ResourceQuery , but not both.

    • 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.

      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 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.

    • 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.

      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 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.

    • 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.

      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 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.

    • 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.

      • 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.

    • 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.

      • 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.