You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.ResourceGroups

Inherits:
AWS.Service show all
Identifier:
resourcegroups
API Version:
2017-11-27
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AWS Resource Groups lets you organize AWS resources such as Amazon EC2 instances, Amazon Relational Database Service databases, and Amazon S3 buckets into groups using criteria that you define as tags. A resource group is a collection of resources that match the resource types specified in a query, and share one or more tags or portions of tags. You can create a group of resources based on their roles in your cloud infrastructure, lifecycle stages, regions, application layers, or virtually any criteria. Resource Groups enable you to automate management tasks, such as those in AWS Systems Manager Automation documents, on tag-related resources in AWS Systems Manager. Groups of tagged resources also let you quickly view a custom console in AWS Systems Manager that shows AWS Config compliance and other monitoring data about member resources.

To create a resource group, build a resource query, and specify tags that identify the criteria that members of the group have in common. Tags are key-value pairs.

For more information about Resource Groups, see the AWS Resource Groups User Guide.

AWS Resource Groups uses a REST-compliant API that you can use to perform the following types of operations.

  • Create, Read, Update, and Delete (CRUD) operations on resource groups and resource query entities

  • Applying, editing, and removing tags from resource groups

  • Resolving resource group member ARNs so they can be returned as search results

  • Getting data about resources that are members of a group

  • Searching AWS resources based on a resource query

Sending a Request Using ResourceGroups

var resourcegroups = new AWS.ResourceGroups();
resourcegroups.createGroup(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the ResourceGroups object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var resourcegroups = new AWS.ResourceGroups({apiVersion: '2017-11-27'});

You can also set the API version globally in AWS.config.apiVersions using the resourcegroups service identifier:

AWS.config.apiVersions = {
  resourcegroups: '2017-11-27',
  // other service API versions
};

var resourcegroups = new AWS.ResourceGroups();

Version:

  • 2017-11-27

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.ResourceGroups(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a ResourceGroups object

var resourcegroups = new AWS.ResourceGroups({apiVersion: '2017-11-27'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.ResourceGroups.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.ResourceGroups.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.ResourceGroups.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createGroup(params = {}, callback) ⇒ AWS.Request

Creates a resource group with the specified name and description. You can optionally include a resource query, or a service configuration. For more information about constructing a resource query, see Create a tag-based group in Resource Groups. For more information about service configurations, see Service configurations for resource groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:CreateGroup

Service Reference:

Examples:

Calling the createGroup operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Configuration: [
    {
      Type: 'STRING_VALUE', /* required */
      Parameters: [
        {
          Name: 'STRING_VALUE', /* required */
          Values: [
            'STRING_VALUE',
            /* more items */
          ]
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  Description: 'STRING_VALUE',
  ResourceQuery: {
    Query: 'STRING_VALUE', /* required */
    Type: TAG_FILTERS_1_0 | CLOUDFORMATION_STACK_1_0 /* required */
  },
  Tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
resourcegroups.createGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with AWS or aws; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.

    • Description — (String)

      The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.

    • ResourceQuery — (map)

      The resource query that determines which AWS resources are members of this group. For more information about resource queries, see Create a tag-based group in Resource Groups.

      Note: A resource group can contain either a ResourceQuery or a Configuration, but not both.
      • Typerequired — (String)

        The type of the query. You can use the following values:

        • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

          For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

          [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

          The results of this query could include the following.

          • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

          • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

          The query would not include the following items in the results, however.

          • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

            The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

          • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

            The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

        Possible values include:
        • "TAG_FILTERS_1_0"
        • "CLOUDFORMATION_STACK_1_0"
      • Queryrequired — (String)

        The query that defines a group or a search.

    • Tags — (map<String>)

      The tags to add to the group. A tag is key-value pair string.

    • Configuration — (Array<map>)

      A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of GroupConfigurationItem elements. For details about the syntax of service configurations, see Service configurations for resource groups.

      Note: A resource group can contain either a Configuration or a ResourceQuery, but not both.
      • Typerequired — (String)

        Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

      • Parameters — (Array<map>)

        A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

        • Namerequired — (String)

          The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

        • Values — (Array<String>)

          The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        The description of the resource group.

        • GroupArnrequired — (String)

          The ARN of the resource group.

        • Namerequired — (String)

          The name of the resource group.

        • Description — (String)

          The description of the resource group.

      • ResourceQuery — (map)

        The resource query associated with the group. For more information about resource queries, see Create a tag-based group in Resource Groups.

        • Typerequired — (String)

          The type of the query. You can use the following values:

          • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

          • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

            For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

            [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

            The results of this query could include the following.

            • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

            • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

            The query would not include the following items in the results, however.

            • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

              The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

            • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

              The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

          Possible values include:
          • "TAG_FILTERS_1_0"
          • "CLOUDFORMATION_STACK_1_0"
        • Queryrequired — (String)

          The query that defines a group or a search.

      • Tags — (map<String>)

        The tags associated with the group.

      • GroupConfiguration — (map)

        The service configuration associated with the resource group. For details about the syntax of a service configuration, see Service configurations for resource groups.

        • Configuration — (Array<map>)

          The configuration currently associated with the group and in effect.

          • Typerequired — (String)

            Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

          • Parameters — (Array<map>)

            A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Namerequired — (String)

              The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Values — (Array<String>)

              The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

        • ProposedConfiguration — (Array<map>)

          If present, the new configuration that is in the process of being applied to the group.

          • Typerequired — (String)

            Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

          • Parameters — (Array<map>)

            A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Namerequired — (String)

              The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Values — (Array<String>)

              The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

        • Status — (String)

          The current status of an attempt to update the group configuration.

          Possible values include:
          • "UPDATING"
          • "UPDATE_COMPLETE"
          • "UPDATE_FAILED"
        • FailureReason — (String)

          If present, the reason why a request to update the group configuration failed.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteGroup(params = {}, callback) ⇒ AWS.Request

Deletes the specified resource group. Deleting a resource group does not delete any resources that are members of the group; it only deletes the group structure.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:DeleteGroup

Service Reference:

Examples:

Calling the deleteGroup operation

var params = {
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
resourcegroups.deleteGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Deprecated - don't use this parameter. Use Group instead.

    • Group — (String)

      The name or the ARN of the resource group to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        A full description of the deleted resource group.

        • GroupArnrequired — (String)

          The ARN of the resource group.

        • Namerequired — (String)

          The name of the resource group.

        • Description — (String)

          The description of the resource group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroup(params = {}, callback) ⇒ AWS.Request

Returns information about a specified resource group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetGroup

Service Reference:

Examples:

Calling the getGroup operation

var params = {
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
resourcegroups.getGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Deprecated - don't use this parameter. Use Group instead.

    • Group — (String)

      The name or the ARN of the resource group to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        A full description of the resource group.

        • GroupArnrequired — (String)

          The ARN of the resource group.

        • Namerequired — (String)

          The name of the resource group.

        • Description — (String)

          The description of the resource group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroupConfiguration(params = {}, callback) ⇒ AWS.Request

Returns the service configuration associated with the specified resource group. For details about the service configuration syntax, see Service configurations for resource groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetGroupConfiguration

Service Reference:

Examples:

Calling the getGroupConfiguration operation

var params = {
  Group: 'STRING_VALUE'
};
resourcegroups.getGroupConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Group — (String)

      The name or the ARN of the resource group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • GroupConfiguration — (map)

        The service configuration associated with the specified group. For details about the service configuration syntax, see Service configurations for resource groups.

        • Configuration — (Array<map>)

          The configuration currently associated with the group and in effect.

          • Typerequired — (String)

            Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

          • Parameters — (Array<map>)

            A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Namerequired — (String)

              The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Values — (Array<String>)

              The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

        • ProposedConfiguration — (Array<map>)

          If present, the new configuration that is in the process of being applied to the group.

          • Typerequired — (String)

            Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

          • Parameters — (Array<map>)

            A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Namerequired — (String)

              The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

            • Values — (Array<String>)

              The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

        • Status — (String)

          The current status of an attempt to update the group configuration.

          Possible values include:
          • "UPDATING"
          • "UPDATE_COMPLETE"
          • "UPDATE_FAILED"
        • FailureReason — (String)

          If present, the reason why a request to update the group configuration failed.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroupQuery(params = {}, callback) ⇒ AWS.Request

Retrieves the resource query associated with the specified resource group. For more information about resource queries, see Create a tag-based group in Resource Groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetGroupQuery

Service Reference:

Examples:

Calling the getGroupQuery operation

var params = {
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
resourcegroups.getGroupQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Don't use this parameter. Use Group instead.

    • Group — (String)

      The name or the ARN of the resource group to query.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • GroupQuery — (map)

        The resource query associated with the specified group. For more information about resource queries, see Create a tag-based group in Resource Groups.

        • GroupNamerequired — (String)

          The name of the resource group that is associated with the specified resource query.

        • ResourceQueryrequired — (map)

          The resource query that determines which AWS resources are members of the associated resource group.

          • Typerequired — (String)

            The type of the query. You can use the following values:

            • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

            • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

              For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

              [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

              The results of this query could include the following.

              • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

              • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

              The query would not include the following items in the results, however.

              • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

                The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

              • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

                The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

            Possible values include:
            • "TAG_FILTERS_1_0"
            • "CLOUDFORMATION_STACK_1_0"
          • Queryrequired — (String)

            The query that defines a group or a search.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getTags(params = {}, callback) ⇒ AWS.Request

Returns a list of tags that are associated with a resource group, specified by an ARN.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetTags

Service Reference:

Examples:

Calling the getTags operation

var params = {
  Arn: 'STRING_VALUE' /* required */
};
resourcegroups.getTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The ARN of the resource group whose tags you want to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The ARN of the tagged resource group.

      • Tags — (map<String>)

        The tags associated with the specified resource group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

groupResources(params = {}, callback) ⇒ AWS.Request

Adds the specified resources to the specified group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GroupResources

Service Reference:

Examples:

Calling the groupResources operation

var params = {
  Group: 'STRING_VALUE', /* required */
  ResourceArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
resourcegroups.groupResources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Group — (String)

      The name or the ARN of the resource group to add resources to.

    • ResourceArns — (Array<String>)

      The list of ARNs for resources to be added to the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Succeeded — (Array<String>)

        A list of ARNs of resources that were successfully added to the group by this operation.

      • Failed — (Array<map>)

        A list of ARNs of any resources that failed to be added to the group by this operation.

        • ResourceArn — (String)

          The ARN of the resource that failed to be added or removed.

        • ErrorMessage — (String)

          The error message text associated with the failure.

        • ErrorCode — (String)

          The error code associated with the failure.

      • Pending — (Array<map>)

        A list of ARNs of any resources that are still in the process of being added to the group by this operation. These pending additions continue asynchronously. You can check the status of pending additions by using the ListGroupResources operation, and checking the Resources array in the response and the Status field of each object in that array.

        • ResourceArn — (String)

          The Amazon resource name (ARN) of the resource that's in a pending state.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listGroupResources(params = {}, callback) ⇒ AWS.Request

Returns a list of ARNs of the resources that are members of a specified resource group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:ListGroupResources

  • cloudformation:DescribeStacks

  • cloudformation:ListStackResources

  • tag:GetResources

Service Reference:

Examples:

Calling the listGroupResources operation

var params = {
  Filters: [
    {
      Name: resource-type, /* required */
      Values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
resourcegroups.listGroupResources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Deprecated - don't use this parameter. Use the Group request field instead.

    • Group — (String)

      The name or the ARN of the resource group

    • Filters — (Array<map>)

      Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation. Filters the results to include only those of the specified resource types.

      • resource-type - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.

      When you specify a resource-type filter for ListGroupResources, AWS Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but your resource-type filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, a ListGroupResources request returns a BadRequestException error with a message similar to the following:

      The resource types specified as filters in the request are not valid.

      The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn't occur when the group query specifies AWS::AllSupported, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or AWS CloudFormation stack-based queries).

      • Namerequired — (String)

        The name of the filter. Filter names are case-sensitive.

        Possible values include:
        • "resource-type"
      • Valuesrequired — (Array<String>)

        One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.

    • MaxResults — (Integer)

      The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

    • NextToken — (String)

      The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken response to indicate where the output should continue from.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Resources — (Array<map>)

        An array of resources from which you can determine each resource's identity, type, and group membership status.

        • Identifier — (map)

          A structure that contains the ARN of a resource and its resource type.

          • ResourceArn — (String)

            The ARN of a resource.

          • ResourceType — (String)

            The resource type of a resource, such as AWS::EC2::Instance.

        • Status — (map)

          A structure that contains the status of this resource's membership in the group.

          Note: This field is present in the response only if the group is of type AWS::EC2::HostManagement.
          • Name — (String)

            The current status.

            Possible values include:
            • "PENDING"
      • ResourceIdentifiers — (Array<map>)

        Deprecated - don't use this parameter. Use the Resources response field instead.

        • ResourceArn — (String)

          The ARN of a resource.

        • ResourceType — (String)

          The resource type of a resource, such as AWS::EC2::Instance.

      • NextToken — (String)

        If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.

      • QueryErrors — (Array<map>)

        A list of QueryError objects. Each error is an object that contains ErrorCode and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.

        • ErrorCode — (String)

          Possible values are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.

          Possible values include:
          • "CLOUDFORMATION_STACK_INACTIVE"
          • "CLOUDFORMATION_STACK_NOT_EXISTING"
        • Message — (String)

          A message that explains the ErrorCode value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listGroups(params = {}, callback) ⇒ AWS.Request

Returns a list of existing resource groups in your account.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:ListGroups

Service Reference:

Examples:

Calling the listGroups operation

var params = {
  Filters: [
    {
      Name: resource-type | configuration-type, /* required */
      Values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
resourcegroups.listGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups operation.

      • resource-type - Filter the results to include only those of the specified resource types. Specify up to five resource types in the format AWS::ServiceCode::ResourceType . For example, AWS::EC2::Instance, or AWS::S3::Bucket.

      • configuration-type - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:

        • AWS:EC2::CapacityReservationPool

        • AWS:EC2::HostManagement

      • Namerequired — (String)

        The name of the filter. Filter names are case-sensitive.

        Possible values include:
        • "resource-type"
        • "configuration-type"
      • Valuesrequired — (Array<String>)

        One or more filter values. Allowed filter values vary by group filter name, and are case-sensitive.

    • MaxResults — (Integer)

      The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

    • NextToken — (String)

      The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken response to indicate where the output should continue from.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • GroupIdentifiers — (Array<map>)

        A list of GroupIdentifier objects. Each identifier is an object that contains both the Name and the GroupArn.

        • GroupName — (String)

          The name of the resource group.

        • GroupArn — (String)

          The ARN of the resource group.

      • Groups — (Array<map>)

        Deprecated - don't use this field. Use the GroupIdentifiers response field instead.

        • GroupArnrequired — (String)

          The ARN of the resource group.

        • Namerequired — (String)

          The name of the resource group.

        • Description — (String)

          The description of the resource group.

      • NextToken — (String)

        If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putGroupConfiguration(params = {}, callback) ⇒ AWS.Request

Attaches a service configuration to the specified group. This occurs asynchronously, and can take time to complete. You can use GetGroupConfiguration to check the status of the update.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:PutGroupConfiguration

Service Reference:

Examples:

Calling the putGroupConfiguration operation

var params = {
  Configuration: [
    {
      Type: 'STRING_VALUE', /* required */
      Parameters: [
        {
          Name: 'STRING_VALUE', /* required */
          Values: [
            'STRING_VALUE',
            /* more items */
          ]
        },
        /* more items */
      ]
    },
    /* more items */
  ],
  Group: 'STRING_VALUE'
};
resourcegroups.putGroupConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Group — (String)

      The name or ARN of the resource group with the configuration that you want to update.

    • Configuration — (Array<map>)

      The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of GroupConfigurationItem elements.

      For information about the syntax of a service configuration, see Service configurations for resource groups.

      Note: A resource group can contain either a Configuration or a ResourceQuery, but not both.
      • Typerequired — (String)

        Specifies the type of group configuration item. Each item must have a unique value for type. For the list of types that you can specify for a configuration item, see Supported resource types and parameters.

      • Parameters — (Array<map>)

        A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

        • Namerequired — (String)

          The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters.

        • Values — (Array<String>)

          The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

searchResources(params = {}, callback) ⇒ AWS.Request

Returns a list of AWS resource identifiers that matches the specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:SearchResources

  • cloudformation:DescribeStacks

  • cloudformation:ListStackResources

  • tag:GetResources

Service Reference:

Examples:

Calling the searchResources operation

var params = {
  ResourceQuery: { /* required */
    Query: 'STRING_VALUE', /* required */
    Type: TAG_FILTERS_1_0 | CLOUDFORMATION_STACK_1_0 /* required */
  },
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
resourcegroups.searchResources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceQuery — (map)

      The search query, using the same formats that are supported for resource group definition. For more information, see CreateGroup.

      • Typerequired — (String)

        The type of the query. You can use the following values:

        • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

          For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

          [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

          The results of this query could include the following.

          • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

          • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

          The query would not include the following items in the results, however.

          • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

            The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

          • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

            The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

        Possible values include:
        • "TAG_FILTERS_1_0"
        • "CLOUDFORMATION_STACK_1_0"
      • Queryrequired — (String)

        The query that defines a group or a search.

    • MaxResults — (Integer)

      The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

    • NextToken — (String)

      The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken response to indicate where the output should continue from.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ResourceIdentifiers — (Array<map>)

        The ARNs and resource types of resources that are members of the group that you specified.

        • ResourceArn — (String)

          The ARN of a resource.

        • ResourceType — (String)

          The resource type of a resource, such as AWS::EC2::Instance.

      • NextToken — (String)

        If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.

      • QueryErrors — (Array<map>)

        A list of QueryError objects. Each error is an object that contains ErrorCode and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.

        • ErrorCode — (String)

          Possible values are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.

          Possible values include:
          • "CLOUDFORMATION_STACK_INACTIVE"
          • "CLOUDFORMATION_STACK_NOT_EXISTING"
        • Message — (String)

          A message that explains the ErrorCode value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tag(params = {}, callback) ⇒ AWS.Request

Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters.

Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:Tag

Service Reference:

Examples:

Calling the tag operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  Tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
resourcegroups.tag(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The ARN of the resource group to which to add tags.

    • Tags — (map<String>)

      The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The ARN of the tagged resource.

      • Tags — (map<String>)

        The tags that have been added to the specified resource group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

ungroupResources(params = {}, callback) ⇒ AWS.Request

Removes the specified resources from the specified group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:UngroupResources

Service Reference:

Examples:

Calling the ungroupResources operation

var params = {
  Group: 'STRING_VALUE', /* required */
  ResourceArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
resourcegroups.ungroupResources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Group — (String)

      The name or the ARN of the resource group from which to remove the resources.

    • ResourceArns — (Array<String>)

      The ARNs of the resources to be removed from the group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Succeeded — (Array<String>)

        A list of resources that were successfully removed from the group by this operation.

      • Failed — (Array<map>)

        A list of any resources that failed to be removed from the group by this operation.

        • ResourceArn — (String)

          The ARN of the resource that failed to be added or removed.

        • ErrorMessage — (String)

          The error message text associated with the failure.

        • ErrorCode — (String)

          The error code associated with the failure.

      • Pending — (Array<map>)

        A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the ListGroupResources operation. After the resource is successfully removed, it no longer appears in the response.

        • ResourceArn — (String)

          The Amazon resource name (ARN) of the resource that's in a pending state.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untag(params = {}, callback) ⇒ AWS.Request

Deletes tags from a specified resource group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:Untag

Service Reference:

Examples:

Calling the untag operation

var params = {
  Arn: 'STRING_VALUE', /* required */
  Keys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
resourcegroups.untag(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Arn — (String)

      The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.

    • Keys — (Array<String>)

      The keys of the tags to be removed.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The ARN of the resource group from which tags have been removed.

      • Keys — (Array<String>)

        The keys of the tags that were removed.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateGroup(params = {}, callback) ⇒ AWS.Request

Updates the description for an existing group. You cannot update the name of a resource group.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:UpdateGroup

Service Reference:

Examples:

Calling the updateGroup operation

var params = {
  Description: 'STRING_VALUE',
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
resourcegroups.updateGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Don't use this parameter. Use Group instead.

    • Group — (String)

      The name or the ARN of the resource group to modify.

    • Description — (String)

      The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Group — (map)

        The update description of the resource group.

        • GroupArnrequired — (String)

          The ARN of the resource group.

        • Namerequired — (String)

          The name of the resource group.

        • Description — (String)

          The description of the resource group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateGroupQuery(params = {}, callback) ⇒ AWS.Request

Updates the resource query of a group. For more information about resource queries, see Create a tag-based group in Resource Groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:UpdateGroupQuery

Service Reference:

Examples:

Calling the updateGroupQuery operation

var params = {
  ResourceQuery: { /* required */
    Query: 'STRING_VALUE', /* required */
    Type: TAG_FILTERS_1_0 | CLOUDFORMATION_STACK_1_0 /* required */
  },
  Group: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
resourcegroups.updateGroupQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      Don't use this parameter. Use Group instead.

    • Group — (String)

      The name or the ARN of the resource group to query.

    • ResourceQuery — (map)

      The resource query to determine which AWS resources are members of this resource group.

      Note: A resource group can contain either a Configuration or a ResourceQuery, but not both.
      • Typerequired — (String)

        The type of the query. You can use the following values:

        • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

          For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

          [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

          The results of this query could include the following.

          • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

          • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

          The query would not include the following items in the results, however.

          • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

            The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

          • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

            The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

        Possible values include:
        • "TAG_FILTERS_1_0"
        • "CLOUDFORMATION_STACK_1_0"
      • Queryrequired — (String)

        The query that defines a group or a search.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • GroupQuery — (map)

        The updated resource query associated with the resource group after the update.

        • GroupNamerequired — (String)

          The name of the resource group that is associated with the specified resource query.

        • ResourceQueryrequired — (map)

          The resource query that determines which AWS resources are members of the associated resource group.

          • Typerequired — (String)

            The type of the query. You can use the following values:

            • CLOUDFORMATION_STACK_1_0: Specifies that the Query contains an ARN for a CloudFormation stack.

            • TAG_FILTERS_1_0: Specifies that the Query parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to the GetResources operation, but uses only the ResourceTypeFilters and TagFilters fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.

              For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each:

              [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]

              The results of this query could include the following.

              • An EC2 instance that has the following two tags: {"Stage":"Deploy"}, and {"Version":"2"}

              • An S3 bucket that has the following two tags: {"Stage":"Test"}, and {"Version":"1"}

              The query would not include the following items in the results, however.

              • An EC2 instance that has only the following tag: {"Stage":"Deploy"}.

                The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.

              • An RDS database that has the following two tags: {"Stage":"Archived"} and {"Version":"4"}

                The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.

            Possible values include:
            • "TAG_FILTERS_1_0"
            • "CLOUDFORMATION_STACK_1_0"
          • Queryrequired — (String)

            The query that defines a group or a search.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.