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 minutes when idle before session times out. Default for Spark ETL jobs is value of Timeout. Consult the documentation for other job types.
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 minutes before session times out. Default for Spark ETL jobs is 48 hours (2880 minutes), the maximum session lifetime for this job type. Consult the documentation for other job types.
Type: Integer
Valid Range: Minimum value of 1.
Required: No
- WorkerType
-
The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, or G.8X for Spark jobs. Accepts the value Z.2X for Ray notebooks.
-
For the
G.1X
worker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 84GB disk (approximately 34GB free), and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs. -
For the
G.2X
worker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 128GB disk (approximately 77GB free), and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs. -
For the
G.4X
worker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk (approximately 235GB free), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for AWS Glue version 3.0 or later Spark ETL jobs in the following AWS Regions: US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), and Europe (Stockholm). -
For the
G.8X
worker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk (approximately 487GB free), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for AWS Glue version 3.0 or later Spark ETL jobs, in the same AWS Regions as supported for theG.4X
worker type. -
For the
Z.2X
worker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk (approximately 120GB free), and provides up to 8 Ray workers based on the autoscaler.
Type: String
Valid Values:
Standard | G.1X | G.2X | G.025X | G.4X | G.8X | Z.2X
Required: No
-
Response Syntax
{
"Session": {
"Command": {
"Name": "string",
"PythonVersion": "string"
},
"CompletedOn": number,
"Connections": {
"Connections": [ "string" ]
},
"CreatedOn": number,
"DefaultArguments": {
"string" : "string"
},
"Description": "string",
"DPUSeconds": number,
"ErrorMessage": "string",
"ExecutionTime": number,
"GlueVersion": "string",
"Id": "string",
"IdleTimeout": number,
"MaxCapacity": number,
"NumberOfWorkers": number,
"ProfileName": "string",
"Progress": number,
"Role": "string",
"SecurityConfiguration": "string",
"Status": "string",
"WorkerType": "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.
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: