AWS Resource Explorer

2023/11/14 - AWS Resource Explorer - 2 new 1 updated api methods

Changes  Resource Explorer supports multi-account search. You can now use Resource Explorer to search and discover resources across AWS accounts within your organization or organizational unit.

ListIndexesForMembers (new) Link ¶

Retrieves a list of a member's indexes in all Amazon Web Services Regions that are currently collecting resource information for Amazon Web Services Resource Explorer. Only the management account or a delegated administrator with service access enabled can invoke this API call.

See also: AWS API Documentation

Request Syntax

client.list_indexes_for_members(
    AccountIdList=[
        'string',
    ],
    MaxResults=123,
    NextToken='string'
)
type AccountIdList

list

param AccountIdList

[REQUIRED]

The account IDs will limit the output to only indexes from these accounts.

  • (string) --

type MaxResults

integer

param MaxResults

The maximum 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 appropriate to the operation. If additional items exist beyond those included in the current response, 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

An API operation can 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.

type NextToken

string

param NextToken

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 of the previous call's NextToken response to indicate where the output should continue from. The pagination tokens expire after 24 hours.

rtype

dict

returns

Response Syntax

{
    'Indexes': [
        {
            'AccountId': 'string',
            'Arn': 'string',
            'Region': 'string',
            'Type': 'LOCAL'|'AGGREGATOR'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Indexes (list) --

      A structure that contains the details and status of each index.

      • (dict) --

        An index is the data store used by Amazon Web Services Resource Explorer to hold information about your Amazon Web Services resources that the service discovers.

        • AccountId (string) --

          The account ID for the index.

        • Arn (string) --

          The Amazon resource name (ARN) of the index.

        • Region (string) --

          The Amazon Web Services Region in which the index exists.

        • Type (string) --

          The type of index. It can be one of the following values:

          • LOCAL – The index contains information about resources from only the same Amazon Web Services Region.

          • AGGREGATOR – Resource Explorer replicates copies of the indexed information about resources in all other Amazon Web Services Regions to the aggregator index. This lets search results in the Region with the aggregator index to include resources from all Regions in the account where Resource Explorer is turned on.

    • 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 . The pagination tokens expire after 24 hours.

GetAccountLevelServiceConfiguration (new) Link ¶

Retrieves the status of your account's Amazon Web Services service access, and validates the service linked role required to access the multi-account search feature. Only the management account or a delegated administrator with service access enabled can invoke this API call.

See also: AWS API Documentation

Request Syntax

client.get_account_level_service_configuration()
rtype

dict

returns

Response Syntax

{
    'OrgConfiguration': {
        'AWSServiceAccessStatus': 'ENABLED'|'DISABLED',
        'ServiceLinkedRole': 'string'
    }
}

Response Structure

  • (dict) --

    • OrgConfiguration (dict) --

      Details about the organization, and whether configuration is ENABLED or DISABLED .

      • AWSServiceAccessStatus (string) --

        This value displays whether your Amazon Web Services service access is ENABLED or DISABLED .

      • ServiceLinkedRole (string) --

        This value shows whether or not you have a valid a service-linked role required to start the multi-account search feature.

CreateView (updated) Link ¶
Changes (request)
{'Scope': 'string'}

Creates a view that users can query by using the Search operation. Results from queries that you make using this view include only resources that match the view's Filters . For more information about Amazon Web Services Resource Explorer views, see Managing views in the Amazon Web Services Resource Explorer User Guide .

Only the principals with an IAM identity-based policy that grants Allow to the Search action on a Resource with the Amazon resource name (ARN) of this view can Search using views you create with this operation.

See also: AWS API Documentation

Request Syntax

client.create_view(
    ClientToken='string',
    Filters={
        'FilterString': 'string'
    },
    IncludedProperties=[
        {
            'Name': 'string'
        },
    ],
    Scope='string',
    Tags={
        'string': 'string'
    },
    ViewName='string'
)
type ClientToken

string

param ClientToken

This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a UUID-type value to ensure the uniqueness of your views.

This field is autopopulated if not provided.

type Filters

dict

param Filters

An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a Search operation, the filter string is combined with the search's QueryString parameter using a logical AND operator.

For information about the supported syntax, see Search query reference for Resource Explorer in the Amazon Web Services Resource Explorer User Guide .

Warning

This query string in the context of this operation supports only filter prefixes with optional operators. It doesn't support free-form text. For example, the string region:us* service:ec2 -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web Services Region that begins with the letters us and is not tagged with a key Stage that has the value prod .

  • FilterString (string) -- [REQUIRED]

    The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a Search operation. For more details, see Search query syntax.

type IncludedProperties

list

param IncludedProperties

Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.

The default is an empty list, with no optional fields included in the results.

  • (dict) --

    Information about an additional property that describes a resource, that you can optionally include in the view. This lets you view that property in search results, and filter your search results based on the value of the property.

    • Name (string) -- [REQUIRED]

      The name of the property that is included in this view.

      You can specify the following property names for this field:

      • Tags

type Scope

string

param Scope

The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.

type Tags

dict

param Tags

Tag key and value pairs that are attached to the view.

  • (string) --

    • (string) --

type ViewName

string

param ViewName

[REQUIRED]

The name of the new view. This name appears in the list of views in Resource Explorer.

The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.

rtype

dict

returns

Response Syntax

{
    'View': {
        'Filters': {
            'FilterString': 'string'
        },
        'IncludedProperties': [
            {
                'Name': 'string'
            },
        ],
        'LastUpdatedAt': datetime(2015, 1, 1),
        'Owner': 'string',
        'Scope': 'string',
        'ViewArn': 'string'
    }
}

Response Structure

  • (dict) --

    • View (dict) --

      A structure that contains the details about the new view.

      • Filters (dict) --

        An array of SearchFilter objects that specify which resources can be included in the results of queries made using this view.

        • FilterString (string) --

          The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a Search operation. For more details, see Search query syntax.

      • IncludedProperties (list) --

        A structure that contains additional information about the view.

        • (dict) --

          Information about an additional property that describes a resource, that you can optionally include in the view. This lets you view that property in search results, and filter your search results based on the value of the property.

          • Name (string) --

            The name of the property that is included in this view.

            You can specify the following property names for this field:

            • Tags

      • LastUpdatedAt (datetime) --

        The date and time when this view was last modified.

      • Owner (string) --

        The Amazon Web Services account that owns this view.

      • Scope (string) --

        An Amazon resource name (ARN) of an Amazon Web Services account, an organization, or an organizational unit (OU) that specifies whether this view includes resources from only the specified Amazon Web Services account, all accounts in the specified organization, or all accounts in the specified OU.

        If not specified, the value defaults to the Amazon Web Services account used to call this operation.

      • ViewArn (string) --

        The Amazon resource name (ARN) of the view.