@@ -131,7 +131,6 @@ export interface ContinuousLoggingProps {
131
131
* event-driven flow using the job.
132
132
*/
133
133
export abstract class JobBase extends cdk . Resource implements IJob {
134
-
135
134
public abstract readonly jobArn : string ;
136
135
public abstract readonly jobName : string ;
137
136
public abstract readonly grantPrincipal : iam . IPrincipal ;
@@ -264,16 +263,13 @@ export abstract class JobBase extends cdk.Resource implements IJob {
264
263
*
265
264
* @param id construct id.
266
265
* @param jobState the job state.
267
- * @private
268
266
*/
269
267
private metricJobStateRule ( id : string , jobState : JobState ) : events . Rule {
270
268
return this . node . tryFindChild ( id ) as events . Rule ?? this . onStateChange ( id , jobState ) ;
271
269
}
272
270
273
271
/**
274
272
* Returns the job arn
275
- * @param scope
276
- * @param jobName
277
273
*/
278
274
protected buildJobArn ( scope : constructs . Construct , jobName : string ) : string {
279
275
return cdk . Stack . of ( scope ) . formatArn ( {
@@ -308,13 +304,12 @@ export interface JobImportAttributes {
308
304
* JobProperties will be used to create new Glue Jobs using this L2 Construct.
309
305
*/
310
306
export interface JobProperties {
311
-
312
307
/**
313
- * Script Code Location (required)
314
- * Script to run when the Glue job executes. Can be uploaded
315
- * from the local directory structure using fromAsset
316
- * or referenced via S3 location using fromBucket
317
- * */
308
+ * Script Code Location (required)
309
+ * Script to run when the Glue job executes. Can be uploaded
310
+ * from the local directory structure using fromAsset
311
+ * or referenced via S3 location using fromBucket
312
+ */
318
313
readonly script : Code ;
319
314
320
315
/**
@@ -326,26 +321,29 @@ export interface JobProperties {
326
321
* and be granted sufficient permissions.
327
322
*
328
323
* @see https://docs.aws.amazon.com/glue/latest/dg/getting-started-access.html
329
- ** /
324
+ */
330
325
readonly role : iam . IRole ;
331
326
332
327
/**
333
328
* Name of the Glue job (optional)
334
329
* Developer-specified name of the Glue job
330
+ *
335
331
* @default - a name is automatically generated
336
- ** /
332
+ */
337
333
readonly jobName ?: string ;
338
334
339
335
/**
340
336
* Description (optional)
341
337
* Developer-specified description of the Glue job
338
+ *
342
339
* @default - no value
343
- ** /
340
+ */
344
341
readonly description ?: string ;
345
342
346
343
/**
347
344
* Number of Workers (optional)
348
345
* Number of workers for Glue to use during job execution
346
+ *
349
347
* @default 10
350
348
*/
351
349
readonly numberOfWorkers ?: number ;
@@ -354,8 +352,9 @@ export interface JobProperties {
354
352
* Worker Type (optional)
355
353
* Type of Worker for Glue to use during job execution
356
354
* Enum options: Standard, G_1X, G_2X, G_025X. G_4X, G_8X, Z_2X
357
- * @default G_1X
358
- **/
355
+ *
356
+ * @default WorkerType.G_1X
357
+ */
359
358
readonly workerType ?: WorkerType ;
360
359
361
360
/**
@@ -366,7 +365,7 @@ export interface JobProperties {
366
365
* you can specify is controlled by a service limit.
367
366
*
368
367
* @default 1
369
- ** /
368
+ */
370
369
readonly maxConcurrentRuns ?: number ;
371
370
372
371
/**
@@ -377,7 +376,7 @@ export interface JobProperties {
377
376
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
378
377
* for a list of reserved parameters
379
378
* @default - no arguments
380
- ** /
379
+ */
381
380
readonly defaultArguments ?: { [ key : string ] : string } ;
382
381
383
382
/**
@@ -386,53 +385,58 @@ export interface JobProperties {
386
385
* Connections are used to connect to other AWS Service or resources within a VPC.
387
386
*
388
387
* @default [] - no connections are added to the job
389
- ** /
388
+ */
390
389
readonly connections ?: IConnection [ ] ;
391
390
392
391
/**
393
392
* Max Retries (optional)
394
393
* Maximum number of retry attempts Glue performs if the job fails
394
+ *
395
395
* @default 0
396
- ** /
396
+ */
397
397
readonly maxRetries ?: number ;
398
398
399
399
/**
400
400
* Timeout (optional)
401
401
* The maximum time that a job run can consume resources before it is
402
402
* terminated and enters TIMEOUT status. Specified in minutes.
403
+ *
403
404
* @default 2880 (2 days for non-streaming)
404
405
*
405
- ** /
406
+ */
406
407
readonly timeout ?: cdk . Duration ;
407
408
408
409
/**
409
410
* Security Configuration (optional)
410
411
* Defines the encryption options for the Glue job
412
+ *
411
413
* @default - no security configuration.
412
- ** /
414
+ */
413
415
readonly securityConfiguration ?: ISecurityConfiguration ;
414
416
415
417
/**
416
418
* Tags (optional)
417
- * A list of key:value pairs of tags to apply to this Glue job resourcex
419
+ * A list of key:value pairs of tags to apply to this Glue job resources
420
+ *
418
421
* @default {} - no tags
419
- ** /
422
+ */
420
423
readonly tags ?: { [ key : string ] : string } ;
421
424
422
425
/**
423
426
* Glue Version
424
427
* The version of Glue to use to execute this job
428
+ *
425
429
* @default 3.0 for ETL
426
- ** /
430
+ */
427
431
readonly glueVersion ?: GlueVersion ;
428
432
429
433
/**
430
434
* Enables the collection of metrics for job profiling.
431
435
*
432
436
* @default - no profiling metrics emitted.
433
437
*
434
- * @see `--enable-metrics` at https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
435
- ** /
438
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
439
+ */
436
440
readonly enableProfilingMetrics ? :boolean ;
437
441
438
442
/**
@@ -444,15 +448,13 @@ export interface JobProperties {
444
448
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
445
449
**/
446
450
readonly continuousLogging ?: ContinuousLoggingProps ;
447
-
448
451
}
449
452
450
453
/**
451
454
* A Glue Job.
452
455
* @resource AWS::Glue::Job
453
456
*/
454
457
export abstract class Job extends JobBase {
455
-
456
458
/**
457
459
* Identifies an existing Glue Job from a subset of attributes that can
458
460
* be referenced from within another Stack or Construct.
@@ -500,7 +502,6 @@ export abstract class Job extends JobBase {
500
502
* @returns String containing the args for the continuous logging command
501
503
*/
502
504
public setupContinuousLogging ( role : iam . IRole , props : ContinuousLoggingProps | undefined ) : any {
503
-
504
505
// If the developer has explicitly disabled continuous logging return no args
505
506
if ( props && ! props . enabled ) {
506
507
return { } ;
@@ -536,7 +537,6 @@ export abstract class Job extends JobBase {
536
537
const s3Location = code . bind ( this , this . role ) . s3Location ;
537
538
return `s3://${ s3Location . bucketName } /${ s3Location . objectKey } ` ;
538
539
}
539
-
540
540
}
541
541
542
542
/**
0 commit comments