We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

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

Resource Groups lets you organize Amazon Web Services resources such as Amazon Elastic Compute Cloud instances, Amazon Relational Database Service databases, and Amazon Simple Storage Service 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 Amazon Web Services Systems Manager Automation documents, on tag-related resources in Amazon Web Services Systems Manager. Groups of tagged resources also let you quickly view a custom console in Amazon Web Services Systems Manager that shows 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 Resource Groups User Guide.

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 Amazon Web Services 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'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

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 either a resource query or a service configuration. For more information about constructing a resource query, see Build queries and groups in Resource Groups in the 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

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 Amazon Web Services Region in your Amazon Web Services 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 Amazon Web Services 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 to perform. This can have one of two values:

        • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

        The query that defines a group or a search. The contents depends on the value of the Type element.

        • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

          • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

          • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

          Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

        • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

          • An Amazon 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 resource query results would not include the following items in the results, however.

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

          Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

        • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in the group.

    • 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 Amazon Web Services 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 to perform. This can have one of two values:

          • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

          • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

          The query that defines a group or a search. The contents depends on the value of the Type element.

          • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

            • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

            • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

            Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

          • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

            • An Amazon 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 resource query results would not include the following items in the results, however.

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

            Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

          • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in the group.

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

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

Retrieves the current status of optional features in Resource Groups.

Service Reference:

Examples:

Calling the getAccountSettings operation

resourcegroups.getAccountSettings(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

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:

      • AccountSettings — (map)

        The current settings for the optional features in Resource Groups.

        • GroupLifecycleEventsDesiredStatus — (String)

          The desired target status of the group lifecycle events feature. If

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
        • GroupLifecycleEventsStatus — (String)

          The current status of the group lifecycle events feature.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "IN_PROGRESS"
          • "ERROR"
        • GroupLifecycleEventsStatusMessage — (String)

          The text of any error message occurs during an attempt to turn group lifecycle events on or off.

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 structure that contains the metadata details for the specified resource group. Use GetGroupQuery and GetGroupConfiguration to get those additional details 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

Retrieves 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 for which you want to retrive the service configuration.

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)

        A structure that describes the service configuration attached 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 Amazon Web Services resources are members of the associated resource group.

          • Typerequired — (String)

            The type of the query to perform. This can have one of two values:

            • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

            • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

            The query that defines a group or a search. The contents depends on the value of the Type element.

            • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

              • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

              • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

              Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

            • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

              • An Amazon 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 resource query results would not include the following items in the results, however.

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

              Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

            • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in the group.

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.

You can use this operation with only resource groups that are configured with the following types:

  • AWS::EC2::HostManagement

  • AWS::EC2::CapacityReservationPool

Other resource group type and resource types aren't currently supported by this operation.

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 of the 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 the resources that this operation successfully added to the group.

      • Failed — (Array<map>)

        A list of ARNs of any resources that this operation failed to add to the group.

        • 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 this operation is still in the process adding to the group. 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, 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 Amazon CloudFront 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)

          Specifies the error code that was raised.

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

          A message that explains the ErrorCode value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFront 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 Amazon Web Services 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 Amazon Web Services 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 to perform. This can have one of two values:

        • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

        The query that defines a group or a search. The contents depends on the value of the Type element.

        • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

          • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

          • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

          Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

        • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

          • An Amazon 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 resource query results would not include the following items in the results, however.

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

          Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

        • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in the group.

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

        • CLOUDFORMATION_STACK_INACTIVE

        • CLOUDFORMATION_STACK_NOT_EXISTING

        • ErrorCode — (String)

          Specifies the error code that was raised.

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

          A message that explains the ErrorCode value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFront 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. This operation works only with static groups that you populated using the GroupResources operation. It doesn't work with any resource groups that are automatically populated by tag-based or CloudFormation stack-based queries.

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.

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

Turns on or turns off optional features in Resource Groups.

The preceding example shows that the request to turn on group lifecycle events is IN_PROGRESS. You can call the GetAccountSettings operation to check for completion by looking for GroupLifecycleEventsStatus to change to ACTIVE.

Service Reference:

Examples:

Calling the updateAccountSettings operation

var params = {
  GroupLifecycleEventsDesiredStatus: ACTIVE | INACTIVE
};
resourcegroups.updateAccountSettings(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: {})
    • GroupLifecycleEventsDesiredStatus — (String)

      Specifies whether you want to turn group lifecycle events on or off.

      Possible values include:
      • "ACTIVE"
      • "INACTIVE"

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:

      • AccountSettings — (map)

        A structure that displays the status of the optional features in the account.

        • GroupLifecycleEventsDesiredStatus — (String)

          The desired target status of the group lifecycle events feature. If

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
        • GroupLifecycleEventsStatus — (String)

          The current status of the group lifecycle events feature.

          Possible values include:
          • "ACTIVE"
          • "INACTIVE"
          • "IN_PROGRESS"
          • "ERROR"
        • GroupLifecycleEventsStatusMessage — (String)

          The text of any error message occurs during an attempt to turn group lifecycle events on or off.

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 Amazon Web Services 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 to perform. This can have one of two values:

        • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

        • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

        The query that defines a group or a search. The contents depends on the value of the Type element.

        • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

          • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

          • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

          Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

        • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

          • An Amazon 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 resource query results would not include the following items in the results, however.

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

          Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

        • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in 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:

      • 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 Amazon Web Services resources are members of the associated resource group.

          • Typerequired — (String)

            The type of the query to perform. This can have one of two values:

            • CLOUDFORMATION_STACK_1_0: Specifies that you want the group to contain the members of an CloudFormation stack. The Query contains a StackIdentifier element with an ARN for a CloudFormation stack.

            • TAG_FILTERS_1_0: Specifies that you want the group to include resource that have tags that match the query.

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

            The query that defines a group or a search. The contents depends on the value of the Type element.

            • ResourceTypeFilters – Applies to all ResourceQuery objects of either Type. This element contains one of the following two items:

              • The value AWS::AllSupported. This causes the ResourceQuery to match resources of any resource type that also match the query.

              • A list (a JSON array) of resource type identifiers that limit the query to only resources of the specified types. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide.

              Example: "ResourceTypeFilters": ["AWS::AllSupported"] or "ResourceTypeFilters": ["AWS::EC2::Instance", "AWS::S3::Bucket"]

            • TagFilters – applicable only if Type = TAG_FILTERS_1_0. The Query contains a JSON string that represents a collection of simple tag filters. 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 resource query could include the following.

              • An Amazon 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 resource query results would not include the following items in the results, however.

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

              Example: "TagFilters": [ { "Key": "Stage", "Values": [ "Gamma", "Beta" ] }

            • StackIdentifier – applicable only if Type = CLOUDFORMATION_STACK_1_0. The value of this parameter is the Amazon Resource Name (ARN) of the CloudFormation stack whose resources you want included in the group.

Returns:

  • (AWS.Request)

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