CreateSession - AWS Glue

CreateSession

Creates a new session.

Request Syntax

{ "Command": { "Name": "string", "PythonVersion": "string" }, "Connections": { "Connections": [ "string" ] }, "DefaultArguments": { "string" : "string" }, "Description": "string", "GlueVersion": "string", "Id": "string", "IdleTimeout": number, "MaxCapacity": number, "NumberOfWorkers": number, "RequestOrigin": "string", "Role": "string", "SecurityConfiguration": "string", "Tags": { "string" : "string" }, "Timeout": number, "WorkerType": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Command

The SessionCommand that runs the job.

Type: SessionCommand object

Required: Yes

Connections

The number of connections to use for the session.

Type: ConnectionsList object

Required: No

DefaultArguments

A map array of key-value pairs. Max is 75 pairs.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 75 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 4096.

Value Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

Description

The description of the session.

Type: String

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

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

GlueVersion

The AWS Glue version determines the versions of Apache Spark and Python that AWS Glue supports. The GlueVersion must be greater than 2.0.

Type: String

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

Pattern: ^\w+\.\w+$

Required: No

Id

The ID of the session request.

Type: String

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

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*

Required: Yes

IdleTimeout

The number of seconds when idle before request times out.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

MaxCapacity

The number of AWS Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.

Type: Double

Required: No

NumberOfWorkers

The number of workers of a defined WorkerType to use for the session.

Type: Integer

Required: No

RequestOrigin

The origin of the request.

Type: String

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

Pattern: [\.\-_A-Za-z0-9]+

Required: No

Role

The IAM Role ARN

Type: String

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

Pattern: arn:aws[^:]*:iam::[0-9]*:role/.+

Required: Yes

SecurityConfiguration

The name of the SecurityConfiguration structure to be used with the session

Type: String

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

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*

Required: No

Tags

The map of key value pairs (tags) belonging to the session.

Type: String to string map

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

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

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

Required: No

Timeout

The number of seconds before request times out.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

WorkerType

The type of predefined worker that is allocated to use for the session. Accepts a value of Standard, G.1X, G.2X, or G.025X.

  • For the Standard worker type, each worker provides 4 vCPU, 16 GB of memory and a 50GB disk, and 2 executors per worker.

  • For the G.1X worker type, each worker maps to 1 DPU (4 vCPU, 16 GB of memory, 64 GB disk), and provides 1 executor per worker. We recommend this worker type for memory-intensive jobs.

  • For the G.2X worker type, each worker maps to 2 DPU (8 vCPU, 32 GB of memory, 128 GB disk), and provides 1 executor per worker. We recommend this worker type for memory-intensive jobs.

  • For the G.025X worker type, each worker maps to 0.25 DPU (2 vCPU, 4 GB of memory, 64 GB disk), and provides 1 executor per worker. We recommend this worker type for low volume streaming jobs. This worker type is only available for AWS Glue version 3.0 streaming jobs.

Type: String

Valid Values: Standard | G.1X | G.2X | G.025X

Required: No

Response Syntax

{ "Session": { "Command": { "Name": "string", "PythonVersion": "string" }, "Connections": { "Connections": [ "string" ] }, "CreatedOn": number, "DefaultArguments": { "string" : "string" }, "Description": "string", "ErrorMessage": "string", "GlueVersion": "string", "Id": "string", "MaxCapacity": number, "Progress": number, "Role": "string", "SecurityConfiguration": "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.

Session

Returns the session object in the response.

Type: Session object

Errors

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

AccessDeniedException

Access to a resource was denied.

HTTP Status Code: 400

AlreadyExistsException

A resource to be created or added already exists.

HTTP Status Code: 400

IdempotentParameterMismatchException

The same unique identifier was associated with two different records.

HTTP Status Code: 400

InternalServiceException

An internal service error occurred.

HTTP Status Code: 500

InvalidInputException

The input provided was not valid.

HTTP Status Code: 400

OperationTimeoutException

The operation timed out.

HTTP Status Code: 400

ResourceNumberLimitExceededException

A resource numerical limit was exceeded.

HTTP Status Code: 400

ValidationException

A value could not be validated.

HTTP Status Code: 400

See Also

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