# CfnSessionProps

Properties for defining a `CfnSession`.

Used as props by: [CfnSession](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnSession.html)

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';
const cfnSessionProps: glue.CfnSessionProps = {
  command: {
    name: 'name',
    pythonVersion: 'pythonVersion',
  },
  id: 'id',
  role: 'role',

  // the properties below are optional
  connections: {
    connections: ['connections'],
  },
  defaultArguments: {
    defaultArgumentsKey: 'defaultArguments',
  },
  description: 'description',
  glueVersion: 'glueVersion',
  idleTimeout: 123,
  maxCapacity: 123,
  numberOfWorkers: 123,
  requestOrigin: 'requestOrigin',
  securityConfiguration: 'securityConfiguration',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  timeout: 123,
  workerType: 'workerType',
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_glue as glue

cfn_session_props = glue.CfnSessionProps(
    command=glue.CfnSession.SessionCommandProperty(
        name="name",
        python_version="pythonVersion"
    ),
    id="id",
    role="role",

    # the properties below are optional
    connections=glue.CfnSession.ConnectionsListProperty(
        connections=["connections"]
    ),
    default_arguments={
        "default_arguments_key": "defaultArguments"
    },
    description="description",
    glue_version="glueVersion",
    idle_timeout=123,
    max_capacity=123,
    number_of_workers=123,
    request_origin="requestOrigin",
    security_configuration="securityConfiguration",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    timeout=123,
    worker_type="workerType"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.glue.*;

CfnSessionProps cfnSessionProps = CfnSessionProps.builder()
        .command(SessionCommandProperty.builder()
                .name("name")
                .pythonVersion("pythonVersion")
                .build())
        .id("id")
        .role("role")

        // the properties below are optional
        .connections(ConnectionsListProperty.builder()
                .connections(List.of("connections"))
                .build())
        .defaultArguments(Map.of(
                "defaultArgumentsKey", "defaultArguments"))
        .description("description")
        .glueVersion("glueVersion")
        .idleTimeout(123)
        .maxCapacity(123)
        .numberOfWorkers(123)
        .requestOrigin("requestOrigin")
        .securityConfiguration("securityConfiguration")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .timeout(123)
        .workerType("workerType")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue;

var cfnSessionProps = new CfnSessionProps {
    Command = new SessionCommandProperty {
        Name = "name",
        PythonVersion = "pythonVersion"
    },
    Id = "id",
    Role = "role",

    // the properties below are optional
    Connections = new ConnectionsListProperty {
        Connections = new [] { "connections" }
    },
    DefaultArguments = new Dictionary<string, string> {
        { "defaultArgumentsKey", "defaultArguments" }
    },
    Description = "description",
    GlueVersion = "glueVersion",
    IdleTimeout = 123,
    MaxCapacity = 123,
    NumberOfWorkers = 123,
    RequestOrigin = "requestOrigin",
    SecurityConfiguration = "securityConfiguration",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Timeout = 123,
    WorkerType = "workerType"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnSessionProps := &CfnSessionProps{
	Command: &SessionCommandProperty{
		Name: jsii.String("name"),
		PythonVersion: jsii.String("pythonVersion"),
	},
	Id: jsii.String("id"),
	Role: jsii.String("role"),

	// the properties below are optional
	Connections: &ConnectionsListProperty{
		Connections: []*string{
			jsii.String("connections"),
		},
	},
	DefaultArguments: map[string]*string{
		"defaultArgumentsKey": jsii.String("defaultArguments"),
	},
	Description: jsii.String("description"),
	GlueVersion: jsii.String("glueVersion"),
	IdleTimeout: jsii.Number(123),
	MaxCapacity: jsii.Number(123),
	NumberOfWorkers: jsii.Number(123),
	RequestOrigin: jsii.String("requestOrigin"),
	SecurityConfiguration: jsii.String("securityConfiguration"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Timeout: jsii.Number(123),
	WorkerType: jsii.String("workerType"),
}
```

## Properties

- `command`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnSession.SessionCommandProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnSession.SessionCommandProperty.html) (required) — The SessionCommand that runs the job.

- `connections`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnSession.ConnectionsListProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnSession.ConnectionsListProperty.html) — Specifies the connections used by the session.

- `defaultArguments`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — A map array of key-value pairs.

  Max is 75 pairs.

- `description`: string — The description of the session.

- `glueVersion`: string — The Glue version determines the versions of Apache Spark and Python that Glue supports.

  The GlueVersion must be greater than 2.0.

- `id`: string (required) — The ID of the session.

- `idleTimeout`: number — The number of minutes when idle before session times out.

  Default is the value of Timeout.

- `maxCapacity`: number — The number of Glue data processing units (DPUs) that can be allocated when the job runs.

- `numberOfWorkers`: number — The number of workers of a defined WorkerType to use for the session.

- `requestOrigin`: string — The origin of the request.

- `role`: string (required) — The IAM Role ARN.

- `securityConfiguration`: string — The name of the SecurityConfiguration structure to be used with the session.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags belonging to the session.

- `timeout`: number — The number of minutes before session times out.

- `workerType`: string — The type of predefined worker that is allocated when a session runs.
