View a markdown version of this page

ListLifecycleExecutionResources - EC2 Image Builder

ListLifecycleExecutionResources

Lists resources that the runtime instance of the image lifecycle identified for lifecycle actions.

Request Syntax

POST /ListLifecycleExecutionResources HTTP/1.1 Content-type: application/json { "lifecycleExecutionId": "string", "maxResults": number, "nextToken": "string", "parentResourceId": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

lifecycleExecutionId

The unique identifier for a runtime instance of the lifecycle policy.

Type: String

Pattern: ^lce-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Required: Yes

maxResults

The maximum number of items to return in a single request.

Type: Integer

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

Required: No

nextToken

A token to specify where to start paginating. Use the nextToken value from a previously truncated response.

Type: String

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

Required: No

parentResourceId

The Amazon Resource Name (ARN) of an image build version to get the output resources for, such as AMIs or container images in Amazon ECR. You can get this value from the resourceId in the top-level response. If you leave this property empty, the response lists the Image Builder resources that the lifecycle execution identified for lifecycle actions. If the image build version that you specify in parentResourceId wasn't part of this lifecycle execution, the response contains an empty list.

Type: String

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

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "lifecycleExecutionId": "string", "lifecycleExecutionState": { "reason": "string", "status": "string" }, "nextToken": "string", "resources": [ { "accountId": "string", "action": { "name": "string", "reason": "string" }, "endTime": number, "imageUris": [ "string" ], "region": "string", "resourceId": "string", "snapshots": [ { "snapshotId": "string", "state": { "reason": "string", "status": "string" } } ], "startTime": number, "state": { "reason": "string", "status": "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.

lifecycleExecutionId

The unique identifier for the runtime instance of the lifecycle policy.

Type: String

Pattern: ^lce-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

lifecycleExecutionState

The current state of the lifecycle runtime instance.

Type: LifecycleExecutionState object

nextToken

The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.

Type: String

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

resources

A list of resources that were identified for lifecycle actions.

Type: Array of LifecycleExecutionResource objects

Errors

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

CallRateLimitExceededException

You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.

HTTP Status Code: 429

ClientException

A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.

HTTP Status Code: 400

ForbiddenException

You are not authorized to perform the requested operation.

HTTP Status Code: 403

InvalidPaginationTokenException

You have provided an invalid pagination token in your request.

HTTP Status Code: 400

InvalidRequestException

The request is malformed or otherwise invalid. Verify the request and try again.

HTTP Status Code: 400

ServiceException

An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.

HTTP Status Code: 500

ServiceUnavailableException

The service is unable to process your request at this time.

HTTP Status Code: 503

Examples

List the resources that a lifecycle execution acted on

The following example lists the resources that the specified lifecycle execution acted on. For a scheduled resource state update that hasn't started to apply changes yet, the resources list is empty.

Sample Request

POST /ListLifecycleExecutionResources HTTP/1.1 Content-type: application/json { "lifecycleExecutionId": "lce-401aefc3-a829-46f6-8fc2-91497988a503" }

Sample Response

HTTP/1.1 200 Content-type: application/json { "resources": [], "lifecycleExecutionId": "lce-401aefc3-a829-46f6-8fc2-91497988a503", "lifecycleExecutionState": { "status": "IN_PROGRESS" } }

See Also

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