Class CfnSession

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ISessionRef, IEnvironmentAware, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-02T11:03:11.129Z") @Stability(Stable) public class CfnSession extends CfnResource implements IInspectable, ISessionRef, ITaggableV2
Resource Type definition for AWS::Glue::Session.

Sessions provide an on-demand, serverless Apache Spark runtime environment for building, testing, and running data preparation and analytics applications.

Example:

 // 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.*;
 CfnSession cfnSession = CfnSession.Builder.create(this, "MyCfnSession")
         .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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnSession

      protected CfnSession(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnSession

      protected CfnSession(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnSession

      @Stability(Stable) public CfnSession(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnSessionProps props)
      Create a new AWS::Glue::Session.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • arnForSession

      @Stability(Stable) @NotNull public static String arnForSession(@NotNull ISessionRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnSession

      @Stability(Stable) @NotNull public static Boolean isCfnSession(@NotNull Object x)
      Checks whether the given object is a CfnSession.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the session.
    • getAttrCreatedOn

      @Stability(Stable) @NotNull public String getAttrCreatedOn()
      The time and date when the session was created.
    • getAttrProgress

      @Stability(Stable) @NotNull public IResolvable getAttrProgress()
      The code execution progress of the session.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The session status.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getSessionRef

      @Stability(Stable) @NotNull public SessionReference getSessionRef()
      A reference to a Session resource.
      Specified by:
      getSessionRef in interface ISessionRef
    • getCommand

      @Stability(Stable) @NotNull public Object getCommand()
      The SessionCommand that runs the job.

      Returns union: either IResolvable or CfnSession.SessionCommandProperty

    • setCommand

      @Stability(Stable) public void setCommand(@NotNull IResolvable value)
      The SessionCommand that runs the job.
    • setCommand

      @Stability(Stable) public void setCommand(@NotNull CfnSession.SessionCommandProperty value)
      The SessionCommand that runs the job.
    • getId

      @Stability(Stable) @NotNull public String getId()
      The ID of the session.
    • setId

      @Stability(Stable) public void setId(@NotNull String value)
      The ID of the session.
    • getRole

      @Stability(Stable) @NotNull public String getRole()
      The IAM Role ARN.
    • setRole

      @Stability(Stable) public void setRole(@NotNull String value)
      The IAM Role ARN.
    • getConnections

      @Stability(Stable) @Nullable public Object getConnections()
      Specifies the connections used by the session.

      Returns union: either IResolvable or CfnSession.ConnectionsListProperty

    • setConnections

      @Stability(Stable) public void setConnections(@Nullable IResolvable value)
      Specifies the connections used by the session.
    • setConnections

      @Stability(Stable) public void setConnections(@Nullable CfnSession.ConnectionsListProperty value)
      Specifies the connections used by the session.
    • getDefaultArguments

      @Stability(Stable) @Nullable public Object getDefaultArguments()
      A map array of key-value pairs.

      Returns union: either IResolvable or Mapinvalid input: '<'String, String>

    • setDefaultArguments

      @Stability(Stable) public void setDefaultArguments(@Nullable IResolvable value)
      A map array of key-value pairs.
    • setDefaultArguments

      @Stability(Stable) public void setDefaultArguments(@Nullable Map<String,String> value)
      A map array of key-value pairs.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the session.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the session.
    • getGlueVersion

      @Stability(Stable) @Nullable public String getGlueVersion()
      The Glue version determines the versions of Apache Spark and Python that Glue supports.
    • setGlueVersion

      @Stability(Stable) public void setGlueVersion(@Nullable String value)
      The Glue version determines the versions of Apache Spark and Python that Glue supports.
    • getIdleTimeout

      @Stability(Stable) @Nullable public Number getIdleTimeout()
      The number of minutes when idle before session times out.
    • setIdleTimeout

      @Stability(Stable) public void setIdleTimeout(@Nullable Number value)
      The number of minutes when idle before session times out.
    • getMaxCapacity

      @Stability(Stable) @Nullable public Number getMaxCapacity()
      The number of Glue data processing units (DPUs) that can be allocated when the job runs.
    • setMaxCapacity

      @Stability(Stable) public void setMaxCapacity(@Nullable Number value)
      The number of Glue data processing units (DPUs) that can be allocated when the job runs.
    • getNumberOfWorkers

      @Stability(Stable) @Nullable public Number getNumberOfWorkers()
      The number of workers of a defined WorkerType to use for the session.
    • setNumberOfWorkers

      @Stability(Stable) public void setNumberOfWorkers(@Nullable Number value)
      The number of workers of a defined WorkerType to use for the session.
    • getRequestOrigin

      @Stability(Stable) @Nullable public String getRequestOrigin()
      The origin of the request.
    • setRequestOrigin

      @Stability(Stable) public void setRequestOrigin(@Nullable String value)
      The origin of the request.
    • getSecurityConfiguration

      @Stability(Stable) @Nullable public String getSecurityConfiguration()
      The name of the SecurityConfiguration structure to be used with the session.
    • setSecurityConfiguration

      @Stability(Stable) public void setSecurityConfiguration(@Nullable String value)
      The name of the SecurityConfiguration structure to be used with the session.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      The tags belonging to the session.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      The tags belonging to the session.
    • getTimeout

      @Stability(Stable) @Nullable public Number getTimeout()
      The number of minutes before session times out.
    • setTimeout

      @Stability(Stable) public void setTimeout(@Nullable Number value)
      The number of minutes before session times out.
    • getWorkerType

      @Stability(Stable) @Nullable public String getWorkerType()
      The type of predefined worker that is allocated when a session runs.
    • setWorkerType

      @Stability(Stable) public void setWorkerType(@Nullable String value)
      The type of predefined worker that is allocated when a session runs.