JobProps Struct
JobProps will be used to create new Glue Jobs using this L2 Construct.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_glue as glue } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
declare const code: glue.Code;
declare const connection: glue.Connection;
declare const logGroup: logs.LogGroup;
declare const role: iam.Role;
declare const securityConfiguration: glue.SecurityConfiguration;
const jobProps: glue.JobProps = {
role: role,
script: code,
// the properties below are optional
connections: [connection],
continuousLogging: {
enabled: false,
// the properties below are optional
conversionPattern: 'conversionPattern',
logGroup: logGroup,
logStreamPrefix: 'logStreamPrefix',
quiet: false,
},
defaultArguments: {
defaultArgumentsKey: 'defaultArguments',
},
description: 'description',
glueVersion: glue.GlueVersion.V0_9,
jobName: 'jobName',
maxConcurrentRuns: 123,
maxRetries: 123,
securityConfiguration: securityConfiguration,
tags: {
tagsKey: 'tags',
},
timeout: cdk.Duration.minutes(30),
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_glue as glue
from aws_cdk import aws_iam as iam
from aws_cdk import aws_logs as logs
# code: glue.Code
# connection: glue.Connection
# log_group: logs.LogGroup
# role: iam.Role
# security_configuration: glue.SecurityConfiguration
job_props = glue.JobProps(
role=role,
script=code,
# the properties below are optional
connections=[connection],
continuous_logging=glue.ContinuousLoggingProps(
enabled=False,
# the properties below are optional
conversion_pattern="conversionPattern",
log_group=log_group,
log_stream_prefix="logStreamPrefix",
quiet=False
),
default_arguments={
"default_arguments_key": "defaultArguments"
},
description="description",
glue_version=glue.GlueVersion.V0_9,
job_name="jobName",
max_concurrent_runs=123,
max_retries=123,
security_configuration=security_configuration,
tags={
"tags_key": "tags"
},
timeout=cdk.Duration.minutes(30)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.glue.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.logs.*;
Code code;
Connection connection;
LogGroup logGroup;
Role role;
SecurityConfiguration securityConfiguration;
JobProps jobProps = JobProps.builder()
.role(role)
.script(code)
// the properties below are optional
.connections(List.of(connection))
.continuousLogging(ContinuousLoggingProps.builder()
.enabled(false)
// the properties below are optional
.conversionPattern("conversionPattern")
.logGroup(logGroup)
.logStreamPrefix("logStreamPrefix")
.quiet(false)
.build())
.defaultArguments(Map.of(
"defaultArgumentsKey", "defaultArguments"))
.description("description")
.glueVersion(GlueVersion.V0_9)
.jobName("jobName")
.maxConcurrentRuns(123)
.maxRetries(123)
.securityConfiguration(securityConfiguration)
.tags(Map.of(
"tagsKey", "tags"))
.timeout(Duration.minutes(30))
.build();
// 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;
using Amazon.CDK.AWS.Glue;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Logs;
Code code;
Connection connection;
LogGroup logGroup;
Role role;
SecurityConfiguration securityConfiguration;
var jobProps = new JobProps {
Role = role,
Script = code,
// the properties below are optional
Connections = new [] { connection },
ContinuousLogging = new ContinuousLoggingProps {
Enabled = false,
// the properties below are optional
ConversionPattern = "conversionPattern",
LogGroup = logGroup,
LogStreamPrefix = "logStreamPrefix",
Quiet = false
},
DefaultArguments = new Dictionary<string, string> {
{ "defaultArgumentsKey", "defaultArguments" }
},
Description = "description",
GlueVersion = GlueVersion.V0_9,
JobName = "jobName",
MaxConcurrentRuns = 123,
MaxRetries = 123,
SecurityConfiguration = securityConfiguration,
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
},
Timeout = Duration.Minutes(30)
};
// 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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var code Code
var connection Connection
var logGroup LogGroup
var role Role
var securityConfiguration SecurityConfiguration
jobProps := &JobProps{
Role: role,
Script: code,
// the properties below are optional
Connections: []IConnection{
connection,
},
ContinuousLogging: &ContinuousLoggingProps{
Enabled: jsii.Boolean(false),
// the properties below are optional
ConversionPattern: jsii.String("conversionPattern"),
LogGroup: logGroup,
LogStreamPrefix: jsii.String("logStreamPrefix"),
Quiet: jsii.Boolean(false),
},
DefaultArguments: map[string]*string{
"defaultArgumentsKey": jsii.String("defaultArguments"),
},
Description: jsii.String("description"),
GlueVersion: awscdk.Aws_glue.GlueVersion_V0_9,
JobName: jsii.String("jobName"),
MaxConcurrentRuns: jsii.Number(123),
MaxRetries: jsii.Number(123),
SecurityConfiguration: securityConfiguration,
Tags: map[string]*string{
"tagsKey": jsii.String("tags"),
},
Timeout: cdk.Duration_Minutes(jsii.Number(30)),
}
Properties
connectionsoptionalIConnection[]connectionsoptionaltyping.List[IConnection]connectionsoptionalList<IConnection>ConnectionsoptionalIConnection[]Connectionsoptional*[]IConnection#Default: [] - no connections are added to the job
continuousLoggingoptionalContinuousLoggingPropscontinuous_loggingoptionalContinuousLoggingPropscontinuousLoggingoptionalContinuousLoggingPropsContinuousLoggingoptionalContinuousLoggingPropsContinuousLoggingoptionalContinuousLoggingProps#Default: continuous logging is enabled.
defaultArgumentsoptional{ [key: string]: string }default_argumentsoptionaltyping.Mapping[str, str]defaultArgumentsoptionalMap<String, String>DefaultArgumentsoptionalIDictionary<string, string>DefaultArgumentsoptional*map[string]*string#Default: no arguments
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.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#Default: no value
glueVersionoptionalGlueVersionglue_versionoptionalGlueVersionglueVersionoptionalGlueVersionGlueVersionoptionalGlueVersionGlueVersionoptionalGlueVersion#Default: determined by the job type: 4.0 for ETL and Streaming, 5.0 for Flex, 3.0 for Python Shell
jobNameoptionalstringjob_nameoptionalstrjobNameoptionalStringJobNameoptionalstringJobNameoptional*string#Default: a name is automatically generated
maxConcurrentRunsoptionalnumbermax_concurrent_runsoptionalint | floatmaxConcurrentRunsoptionalNumberMaxConcurrentRunsoptionaldoubleMaxConcurrentRunsoptional*float64= 1#An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit.
maxRetriesoptionalnumbermax_retriesoptionalint | floatmaxRetriesoptionalNumberMaxRetriesoptionaldoubleMaxRetriesoptional*float64= 0#Can be uploaded from the local directory structure using fromAsset or referenced via S3 location using fromBucket
securityConfigurationoptionalISecurityConfigurationsecurity_configurationoptionalISecurityConfigurationsecurityConfigurationoptionalISecurityConfigurationSecurityConfigurationoptionalISecurityConfigurationSecurityConfigurationoptionalISecurityConfiguration#Default: no security configuration.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#Default: {} - no tags
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration#Default: no value set; Glue applies its service default (2880 minutes for non-streaming jobs)
Specified in minutes.