Skip to content
v2.273.0

PySparkStreamingJobProps Struct ​

Properties for creating a Python Spark ETL job.

Example ​

ts
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
declare const stack: cdk.Stack;
declare const role: iam.IRole;
declare const script: glue.Code;
new glue.PySparkStreamingJob(stack, 'ImportedJob', { role, script });

Properties ​

connectionsIConnection[]connectionstyping.List[IConnection]connectionsList<IConnection>ConnectionsIConnection[]Connections*[]IConnection= [] - no connections are added to…#
Connections (optional) List of connections to use for this Glue job Connections are used to connect to other AWS Service or resources within a VPC.
default

Default: [] - no connections are added to the job

continuousLoggingContinuousLoggingPropscontinuous_loggingContinuousLoggingPropscontinuousLoggingContinuousLoggingPropsContinuousLoggingContinuousLoggingPropsContinuousLoggingContinuousLoggingProps= continuous logging is enabled.#
Enables continuous logging with the specified props.
defaultArguments{ [key: string]: string }default_argumentstyping.Mapping[str, str]defaultArgumentsMap<String, String>DefaultArgumentsIDictionary<string, string>DefaultArguments*map[string]*string= no arguments#
Default Arguments (optional) The default arguments for every run of this Glue job, specified as name-value pairs.
notes

This map is the escape hatch for Glue job arguments that this construct does not model. It MUST NOT be used to set arguments that already have a dedicated prop — configure those through the corresponding prop instead (continuousLogging, enableMetrics, enableObservabilityMetrics, sparkUI, className, extraJars, extraJarsFirst, extraPythonFiles, extraFiles). Passing a construct-managed argument (e.g. --enable-continuous-cloudwatch-log, --enable-metrics, --enable-spark-ui, --job-language) or a Glue-reserved argument (--debug, --mode, --JOB_NAME, --endpoint) here throws at synthesis time, so there is exactly one way to express each intent.

Also note that these are emitted verbatim into the CloudFormation template, so avoid placing secrets here in plaintext. Pass secrets to the job at runtime through AWS Secrets Manager instead. A synthesis-time warning is emitted when an argument key looks like a credential and holds a plaintext literal.

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= no value#
Description (optional) Developer-specified description of the Glue job.
enableMetricsbooleanenable_metricsboolenableMetricsBooleanEnableMetricsboolEnableMetrics*bool= true#
Enable profiling metrics for the Glue job.

When enabled, adds '--enable-metrics' to job arguments.

enableObservabilityMetricsbooleanenable_observability_metricsboolenableObservabilityMetricsBooleanEnableObservabilityMetricsboolEnableObservabilityMetrics*bool= true#
Enable observability metrics for the Glue job.

When enabled, adds '--enable-observability-metrics': 'true' to job arguments.

extraFilesCode[]extra_filestyping.List[Code]extraFilesList<Code>ExtraFilesCode[]ExtraFiles*[]Code= no extra files specified.#
Additional files, such as configuration files that AWS Glue copies to the working directory of your script before executing it.
extraJarsCode[]extra_jarstyping.List[Code]extraJarsList<Code>ExtraJarsCode[]ExtraJars*[]Code= no extra jar files#
Extra Jars S3 URL (optional) S3 URL where additional jar dependencies are located.
extraJarsFirstbooleanextra_jars_firstboolextraJarsFirstBooleanExtraJarsFirstboolExtraJarsFirst*bool= false - priority is not given to…#
Setting this value to true prioritizes the customer's extra JAR files in the classpath.
default

Default: false - priority is not given to user-provided jars

extraPythonFilesCode[]extra_python_filestyping.List[Code]extraPythonFilesList<Code>ExtraPythonFilesCode[]ExtraPythonFiles*[]Code= no extra files#
Extra Python Files S3 URL (optional) S3 URL where additional python dependencies are located.
glueVersionGlueVersionglue_versionGlueVersionglueVersionGlueVersionGlueVersionGlueVersionGlueVersionGlueVersion= determined by the job type: 4.0 …#
Glue Version The version of Glue to use to execute this job.
default

Default: determined by the job type: 4.0 for ETL and Streaming, 5.0 for Flex, 3.0 for Python Shell

jobNamestringjob_namestrjobNameStringJobNamestringJobName*string= a name is automatically generate…#
Name of the Glue job (optional) Developer-specified name of the Glue job.
default

Default: a name is automatically generated

jobRunQueuingEnabledbooleanjob_run_queuing_enabledbooljobRunQueuingEnabledBooleanJobRunQueuingEnabledboolJobRunQueuingEnabled*bool= no job run queuing#
Specifies whether job run queuing is enabled for the job runs for this job.
notes

A value of true means job run queuing is enabled for the job runs. If false or not populated, the job runs will not be considered for queueing. If this field does not match the value set in the job run, then the value from the job run field will be used. This property must be set to false for flex jobs. If this property is enabled, maxRetries must be set to zero.

maxConcurrentRunsnumbermax_concurrent_runsint | floatmaxConcurrentRunsNumberMaxConcurrentRunsdoubleMaxConcurrentRuns*float64= 1#
Max Concurrent Runs (optional) The maximum number of runs this Glue job can concurrently run.

An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit.

maxRetriesnumbermax_retriesint | floatmaxRetriesNumberMaxRetriesdoubleMaxRetries*float64= 0#
Max Retries (optional) Maximum number of retry attempts Glue performs if the job fails.
roleIRoleroleIRoleroleIRoleRoleIRoleRoleIRolerequired#
IAM Role (required) IAM Role to use for Glue job execution Must be specified by the developer because the L2 doesn't have visibility into the actions the script(s) takes during the job execution The role must trust the Glue service principal (glue.amazonaws.com) and be granted sufficient permissions.
scriptCodescriptCodescriptCodeScriptCodeScriptCoderequired#
Script Code Location (required) Script to run when the Glue job executes.

Can be uploaded from the local directory structure using fromAsset or referenced via S3 location using fromBucket

securityConfigurationISecurityConfigurationsecurity_configurationISecurityConfigurationsecurityConfigurationISecurityConfigurationSecurityConfigurationISecurityConfigurationSecurityConfigurationISecurityConfiguration= no security configuration.#
Security Configuration (optional) Defines the encryption options for the Glue job.
sparkUISparkUIPropsspark_uiSparkUIPropssparkUISparkUIPropsSparkUISparkUIPropsSparkUISparkUIProps= Spark UI debugging and monitorin…#
Enables the Spark UI debugging and monitoring with the specified props.
default

Default: Spark UI debugging and monitoring is disabled.

tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string= {} - no tags#
Tags (optional) A list of key:value pairs of tags to apply to this Glue job resources.
timeoutDurationtimeoutDurationtimeoutDurationTimeoutDurationTimeoutDuration= 2880 (2 days for non-streaming)#
Timeout (optional) The maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status.

Specified in minutes.

workerConfigurationWorkerConfigurationworker_configurationWorkerConfigurationworkerConfigurationWorkerConfigurationWorkerConfigurationWorkerConfigurationWorkerConfigurationWorkerConfiguration= the job runs with the G_1X worke…#
The worker type and the number of workers allocated when a job runs.
default

Default: the job runs with the G_1X worker type and 10 workers.

Used as props by ​