View a markdown version of this page

StartSession - Amazon EMR Serverless

StartSession

Creates and starts a new session on the specified application. The application must be in the STARTED state or have AutoStart enabled, and have interactive sessions enabled. This operation is supported for EMR release 7.13.0 and later.

Request Syntax

POST /applications/applicationId/sessions HTTP/1.1 Content-type: application/json { "clientToken": "string", "configurationOverrides": { "runtimeConfiguration": [ { "classification": "string", "configurations": [ "Configuration" ], "properties": { "string" : "string" } } ] }, "executionRoleArn": "string", "idleTimeoutMinutes": number, "name": "string", "tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

applicationId

The ID of the application on which to start the session.

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

Pattern: [0-9a-z]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

clientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token, the server returns the successful response without performing the operation again.

Type: String

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

Pattern: [A-Za-z0-9._-]+

Required: Yes

configurationOverrides

The configuration overrides for the session. Only runtime configuration overrides are supported.

Type: SessionConfigurationOverrides object

Required: No

executionRoleArn

The execution role ARN for the session. Amazon EMR Serverless uses this role to access AWS resources on your behalf during session execution.

Type: String

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

Pattern: arn:(aws[a-zA-Z0-9-]*):iam::([0-9]{12}):(role((\u002F)|(\u002F[\u0021-\u007F]+\u002F))[\w+=,.@-]+)

Required: Yes

idleTimeoutMinutes

The idle timeout in minutes for the session. After the session remains idle for this duration, Amazon EMR Serverless automatically terminates it.

Type: Long

Valid Range: Minimum value of 0. Maximum value of 1000000.

Required: No

name

The optional name for the session.

Type: String

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

Pattern: .*\S.*

Required: No

tags

The tags to assign to the session.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: [A-Za-z0-9 /_.:=+@-]+

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Value Pattern: [A-Za-z0-9 /_.:=+@-]*

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "applicationId": "string", "arn": "string", "sessionId": "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.

applicationId

The output contains the application ID on which the session was started.

Type: String

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

Pattern: [0-9a-z]+

arn

The output contains the ARN of the session.

Type: String

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

Pattern: arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\d{12}):\/applications\/[0-9a-zA-Z]+\/sessions\/[0-9a-zA-Z]+

sessionId

The output contains the ID of the session.

Type: String

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

Pattern: [0-9a-z]+

Errors

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

ConflictException

The request could not be processed because of conflict in the current state of the resource.

HTTP Status Code: 409

InternalServerException

Request processing failed because of an error or failure with the service.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource was not found.

HTTP Status Code: 404

ServiceQuotaExceededException

The maximum number of resources per account has been reached.

HTTP Status Code: 402

ValidationException

The input fails to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

See Also

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