쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

ListResources

포커스 모드
ListResources - AWS Resource Explorer
이 페이지는 귀하의 언어로 번역되지 않았습니다. 번역 요청

Returns a list of resources and their details that match the specified criteria. This query must use a view. If you don’t explicitly specify a view, then Resource Explorer uses the default view for the AWS Region in which you call this operation.

Minimum permissions

To call this operation, you must have the following permissions:

  • Action: resource-explorer-2:Search

    Resource: No specific resource (*).

Request Syntax

POST /ListResources HTTP/1.1 Content-type: application/json { "Filters": { "FilterString": "string" }, "MaxResults": number, "NextToken": "string", "ViewArn": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

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 AWS Resource Explorer User Guide.

Important

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 AWS Region that begins with the letters us and is not tagged with a key Stage that has the value prod.

Type: SearchFilter object

Required: No

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

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: No

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.

Note

The ListResources operation does not generate a NextToken if you set MaxResults to 1000.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Required: No

ViewArn

Specifies the Amazon resource name (ARN) of the view to use for the query. If you don't specify a value for this parameter, then the operation automatically uses the default view for the AWS Region in which you called this operation. If the Region either doesn't have a default view or if you don't have permission to use the default view, then the operation fails with a 401 Unauthorized exception.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1000.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "NextToken": "string", "Resources": [ { "Arn": "string", "LastReportedAt": "string", "OwningAccountId": "string", "Properties": [ { "Data": JSON value, "LastReportedAt": "string", "Name": "string" } ], "Region": "string", "ResourceType": "string", "Service": "string" } ], "ViewArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

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.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Resources

The list of structures that describe the resources that match the query.

Type: Array of Resource objects

ViewArn

The Amazon resource name (ARN) of the view that this operation used to perform the search.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1011.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The credentials that you used to call this operation don't have the minimum required permissions.

HTTP Status Code: 403

InternalServerException

The request failed because of internal service error. Try your request again later.

HTTP Status Code: 500

ResourceNotFoundException

You specified a resource that doesn't exist. Check the ID or ARN that you used to identity the resource, and try again.

HTTP Status Code: 404

ThrottlingException

The request failed because you exceeded a rate limit for this operation. For more information, see Quotas for Resource Explorer.

HTTP Status Code: 429

UnauthorizedException

The principal making the request isn't permitted to perform the operation.

HTTP Status Code: 401

ValidationException

You provided an invalid value for one of the operation's parameters. Check the syntax for the operation, and try again.

HTTP Status Code: 400

Examples

Example

The following example shows how to list of all supported resource types, across all AWS services, within your account or organization. The example response includes a NextToken value, which indicates that there is more output available to retrieve with additional calls.

Sample Request

POST /ListResources HTTP/1.1 Host: resource-explorer-2.us-east-1.amazonaws.com X-Amz-Date: 20221101T200059Z Accept-Encoding: identity User-Agent: <UserAgentString> Content-Length: <PayloadSizeBytes> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> { "Filters": { "FilterString": "service:ec2" }, "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/my-default-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111", "MaxResults": 2, "NextToken": "AG9VOEF1KLEXAMPLEOhJHVwo5chEXAMPLER5XiEpNrgsEXAMPLE...b0CmOFOryHEXAMPLE" }

Sample Response

HTTP/1.1 200 OK Date: Tue, 01 Nov 2022 20:00:59 GMT Content-Type: application/json Content-Length: <PayloadSizeBytes> { "NextToken": "AG9VOEF1KLEXAMPLEOhJHVwo5chEXAMPLER5XiEpNrgsEXAMPLE...b0CmOFOryHEXAMPLE", "Resources": [ { "Arn": "arn:aws:iam::123456789012:policy/service-role/Policy-For-A-Service-Role", "LastReportedAt": "2024-07-21T12:34:42Z", "OwningAccountId": "111122223333", "Properties": [ { "Data": [ { "Key": "Name", "Value": "Example-Name" }, { "Key": "aws:cloudformation:stack-name", "Value": "Stack-Name" }, { "Key": "aws:cloudformation:stack-id", "Value": "arn:aws:cloudformation:us-east-1:111122223333:stack/stack-name-username-region/EXAMPLE8-90ab-cdef-fedc-EXAMPLE33333" }, { "Key": "aws:cloudformation:logical-id", "Value": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } ], "LastReportedAt": "2024-02-26T13:47:30Z", "Name": "tags" } ], "Region": "us-east-1", "ResourceType": "ec2:natgateway", "Service": "ec2" }, { "Arn": "arn:aws:iam::111122223333:policy/service-role/Policy-For-A-Service-Role", "LastReportedAt": "2024-07-21T12:34:42Z", "OwningAccountId": "111122223333", "Properties": [], "Region": "us-east-1", "ResourceType": "ec2:internet-gateway", "Service": "ec2" } ], "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/my-default-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.