@aws-cdk/aws-glue-alpha 2.176.0-alpha.0 → 2.178.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.jsii +6187 -3907
  2. package/.jsii.tabl.json.gz +0 -0
  3. package/.warnings.jsii.js +525 -235
  4. package/README.md +422 -159
  5. package/awslint.json +5 -5
  6. package/lib/code.js +4 -5
  7. package/lib/connection.js +15 -3
  8. package/lib/constants.d.ts +261 -0
  9. package/lib/constants.js +281 -0
  10. package/lib/data-format.js +5 -5
  11. package/lib/data-quality-ruleset.js +6 -3
  12. package/lib/database.js +5 -2
  13. package/lib/external-table.js +20 -2
  14. package/lib/index.d.ts +13 -2
  15. package/lib/index.js +14 -3
  16. package/lib/jobs/job.d.ts +393 -0
  17. package/lib/jobs/job.js +298 -0
  18. package/lib/jobs/pyspark-etl-job.d.ts +81 -0
  19. package/lib/jobs/pyspark-etl-job.js +130 -0
  20. package/lib/jobs/pyspark-flex-etl-job.d.ts +83 -0
  21. package/lib/jobs/pyspark-flex-etl-job.js +137 -0
  22. package/lib/jobs/pyspark-streaming-job.d.ts +81 -0
  23. package/lib/jobs/pyspark-streaming-job.js +130 -0
  24. package/lib/jobs/python-shell-job.d.ts +55 -0
  25. package/lib/jobs/python-shell-job.js +99 -0
  26. package/lib/jobs/ray-job.d.ts +44 -0
  27. package/lib/jobs/ray-job.js +89 -0
  28. package/lib/jobs/scala-spark-etl-job.d.ts +78 -0
  29. package/lib/jobs/scala-spark-etl-job.js +134 -0
  30. package/lib/jobs/scala-spark-flex-etl-job.d.ts +109 -0
  31. package/lib/jobs/scala-spark-flex-etl-job.js +143 -0
  32. package/lib/jobs/scala-spark-streaming-job.d.ts +77 -0
  33. package/lib/jobs/scala-spark-streaming-job.js +131 -0
  34. package/lib/jobs/spark-ui-utils.d.ts +53 -0
  35. package/lib/jobs/spark-ui-utils.js +26 -0
  36. package/lib/s3-table.d.ts +4 -4
  37. package/lib/s3-table.js +20 -2
  38. package/lib/schema.d.ts +1 -1
  39. package/lib/schema.js +2 -2
  40. package/lib/security-configuration.js +5 -2
  41. package/lib/storage-parameter.js +1 -1
  42. package/lib/table-base.d.ts +1 -1
  43. package/lib/table-base.js +2 -2
  44. package/lib/table-deprecated.js +1 -1
  45. package/lib/triggers/trigger-options.d.ts +205 -0
  46. package/lib/triggers/trigger-options.js +39 -0
  47. package/lib/triggers/workflow.d.ts +203 -0
  48. package/lib/triggers/workflow.js +371 -0
  49. package/package.json +8 -8
  50. package/rosetta/default.ts-fixture +1 -1
  51. package/lib/job-executable.d.ts +0 -384
  52. package/lib/job-executable.js +0 -348
  53. package/lib/job.d.ts +0 -574
  54. package/lib/job.js +0 -531
@@ -0,0 +1,205 @@
1
+ import * as cdk from 'aws-cdk-lib/core';
2
+ import { JobState, CrawlerState, ConditionLogicalOperator, PredicateLogical } from '../constants';
3
+ import { IJob } from '../jobs/job';
4
+ import { CfnCrawler } from 'aws-cdk-lib/aws-glue';
5
+ import { ISecurityConfiguration } from '../security-configuration';
6
+ import * as events from 'aws-cdk-lib/aws-events';
7
+ /**
8
+ * Represents a trigger action.
9
+ */
10
+ export interface Action {
11
+ /**
12
+ * The job to be executed.
13
+ *
14
+ * @default - no job is executed
15
+ */
16
+ readonly job?: IJob;
17
+ /**
18
+ * The job arguments used when this trigger fires.
19
+ *
20
+ * @default - no arguments are passed to the job
21
+ */
22
+ readonly arguments?: {
23
+ [key: string]: string;
24
+ };
25
+ /**
26
+ * The job run timeout. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status.
27
+ *
28
+ * @default - the default timeout value set in the job definition
29
+ */
30
+ readonly timeout?: cdk.Duration;
31
+ /**
32
+ * The `SecurityConfiguration` to be used with this action.
33
+ *
34
+ * @default - no security configuration is used
35
+ */
36
+ readonly securityConfiguration?: ISecurityConfiguration;
37
+ /**
38
+ * The name of the crawler to be used with this action.
39
+ *
40
+ * @default - no crawler is used
41
+ */
42
+ readonly crawler?: CfnCrawler;
43
+ }
44
+ /**
45
+ * Represents a trigger schedule.
46
+ */
47
+ export declare class TriggerSchedule {
48
+ readonly expressionString: string;
49
+ /**
50
+ * Creates a new TriggerSchedule instance with a cron expression.
51
+ *
52
+ * @param options The cron options for the schedule.
53
+ * @returns A new TriggerSchedule instance.
54
+ */
55
+ static cron(options: events.CronOptions): TriggerSchedule;
56
+ /**
57
+ * Creates a new TriggerSchedule instance with a custom expression.
58
+ *
59
+ * @param expression The custom expression for the schedule.
60
+ * @returns A new TriggerSchedule instance.
61
+ */
62
+ static expression(expression: string): TriggerSchedule;
63
+ /**
64
+ * @param expressionString The expression string for the schedule.
65
+ */
66
+ private constructor();
67
+ }
68
+ /**
69
+ * Represents a trigger predicate.
70
+ */
71
+ export interface Predicate {
72
+ /**
73
+ * The logical operator to be applied to the conditions.
74
+ *
75
+ * @default - ConditionLogical.AND if multiple conditions are provided, no logical operator if only one condition
76
+ */
77
+ readonly logical?: PredicateLogical;
78
+ /**
79
+ * A list of the conditions that determine when the trigger will fire.
80
+ *
81
+ * @default - no conditions are provided
82
+ */
83
+ readonly conditions?: Condition[];
84
+ }
85
+ /**
86
+ * Represents a trigger condition.
87
+ */
88
+ export interface Condition {
89
+ /**
90
+ * The logical operator for the condition.
91
+ *
92
+ * @default ConditionLogicalOperator.EQUALS
93
+ */
94
+ readonly logicalOperator?: ConditionLogicalOperator;
95
+ /**
96
+ * The job to which this condition applies.
97
+ *
98
+ * @default - no job is specified
99
+ */
100
+ readonly job?: IJob;
101
+ /**
102
+ * The condition job state.
103
+ *
104
+ * @default - no job state is specified
105
+ */
106
+ readonly state?: JobState;
107
+ /**
108
+ * The name of the crawler to which this condition applies.
109
+ *
110
+ * @default - no crawler is specified
111
+ */
112
+ readonly crawlerName?: string;
113
+ /**
114
+ * The condition crawler state.
115
+ *
116
+ * @default - no crawler state is specified
117
+ */
118
+ readonly crawlState?: CrawlerState;
119
+ }
120
+ /**
121
+ * Represents event trigger batch condition.
122
+ */
123
+ export interface EventBatchingCondition {
124
+ /**
125
+ * Number of events that must be received from Amazon EventBridge before EventBridge event trigger fires.
126
+ */
127
+ readonly batchSize: number;
128
+ /**
129
+ * Window of time in seconds after which EventBridge event trigger fires.
130
+ *
131
+ * @default - 900 seconds
132
+ */
133
+ readonly batchWindow?: cdk.Duration;
134
+ }
135
+ /**
136
+ * Properties for configuring a Glue Trigger
137
+ */
138
+ export interface TriggerOptions {
139
+ /**
140
+ * A name for the trigger.
141
+ *
142
+ * @default - no name is provided
143
+ */
144
+ readonly name?: string;
145
+ /**
146
+ * A description for the trigger.
147
+ *
148
+ * @default - no description
149
+ */
150
+ readonly description?: string;
151
+ /**
152
+ * The actions initiated by this trigger.
153
+ */
154
+ readonly actions: Action[];
155
+ }
156
+ /**
157
+ * Properties for configuring an on-demand Glue Trigger.
158
+ */
159
+ export interface OnDemandTriggerOptions extends TriggerOptions {
160
+ }
161
+ /**
162
+ * Properties for configuring a daily-scheduled Glue Trigger.
163
+ */
164
+ export interface DailyScheduleTriggerOptions extends TriggerOptions {
165
+ /**
166
+ * Whether to start the trigger on creation or not.
167
+ *
168
+ * @default - false
169
+ */
170
+ readonly startOnCreation?: boolean;
171
+ }
172
+ /**
173
+ * Properties for configuring a weekly-scheduled Glue Trigger.
174
+ */
175
+ export interface WeeklyScheduleTriggerOptions extends DailyScheduleTriggerOptions {
176
+ }
177
+ /**
178
+ * Properties for configuring a custom-scheduled Glue Trigger.
179
+ */
180
+ export interface CustomScheduledTriggerOptions extends WeeklyScheduleTriggerOptions {
181
+ /**
182
+ * The custom schedule for the trigger.
183
+ */
184
+ readonly schedule: TriggerSchedule;
185
+ }
186
+ /**
187
+ * Properties for configuring an Event Bridge based Glue Trigger.
188
+ */
189
+ export interface NotifyEventTriggerOptions extends TriggerOptions {
190
+ /**
191
+ * Batch condition for the trigger.
192
+ *
193
+ * @default - no batch condition
194
+ */
195
+ readonly eventBatchingCondition?: EventBatchingCondition;
196
+ }
197
+ /**
198
+ * Properties for configuring a Condition (Predicate) based Glue Trigger.
199
+ */
200
+ export interface ConditionalTriggerOptions extends DailyScheduleTriggerOptions {
201
+ /**
202
+ * The predicate for the trigger.
203
+ */
204
+ readonly predicate: Predicate;
205
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TriggerSchedule = void 0;
5
+ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
6
+ const events = require("aws-cdk-lib/aws-events");
7
+ /**
8
+ * Represents a trigger schedule.
9
+ */
10
+ class TriggerSchedule {
11
+ /**
12
+ * Creates a new TriggerSchedule instance with a cron expression.
13
+ *
14
+ * @param options The cron options for the schedule.
15
+ * @returns A new TriggerSchedule instance.
16
+ */
17
+ static cron(options) {
18
+ return new TriggerSchedule(events.Schedule.cron(options).expressionString);
19
+ }
20
+ /**
21
+ * Creates a new TriggerSchedule instance with a custom expression.
22
+ *
23
+ * @param expression The custom expression for the schedule.
24
+ * @returns A new TriggerSchedule instance.
25
+ */
26
+ static expression(expression) {
27
+ return new TriggerSchedule(expression);
28
+ }
29
+ /**
30
+ * @param expressionString The expression string for the schedule.
31
+ */
32
+ constructor(expressionString) {
33
+ this.expressionString = expressionString;
34
+ }
35
+ }
36
+ exports.TriggerSchedule = TriggerSchedule;
37
+ _a = JSII_RTTI_SYMBOL_1;
38
+ TriggerSchedule[_a] = { fqn: "@aws-cdk/aws-glue-alpha.TriggerSchedule", version: "2.178.0-alpha.0" };
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJpZ2dlci1vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidHJpZ2dlci1vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBS0EsaURBQWlEO0FBMENqRDs7R0FFRztBQUNILE1BQWEsZUFBZTtJQUMxQjs7Ozs7T0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ogUHJvcGVydGllcyBmb3IgY29uZmlndXJpbmcgYW4gRXZlbnQgQnJpZGdlIGJhc2VkIEdsdWUgVHJpZ2dlci5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBOb3RpZnlFdmVudFRyaWdnZXJPcHRpb25zIGV4dGVuZHMgVHJpZ2dlck9wdGlvbnMge1xuICAvKipcbiAgICogQmF0Y2ggY29uZGl0aW9uIGZvciB0aGUgdHJpZ2dlci5cbiAgICpcbiAgICogQGRlZmF1bHQgLSBubyBiYXRjaCBjb25kaXRpb25cbiAgICovXG4gIHJlYWRvbmx5IGV2ZW50QmF0Y2hpbmdDb25kaXRpb24/OiBFdmVudEJhdGNoaW5nQ29uZGl0aW9uO1xufVxuXG4vKipcbiAqIFByb3BlcnRpZXMgZm9yIGNvbmZpZ3VyaW5nIGEgQ29uZGl0aW9uIChQcmVkaWNhdGUpIGJhc2VkIEdsdWUgVHJpZ2dlci5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBDb25kaXRpb25hbFRyaWdnZXJPcHRpb25zIGV4dGVuZHMgRGFpbHlTY2hlZHVsZVRyaWdnZXJPcHRpb25ze1xuICAvKipcbiAgICogVGhlIHByZWRpY2F0ZSBmb3IgdGhlIHRyaWdnZXIuXG4gICAqL1xuICByZWFkb25seSBwcmVkaWNhdGU6IFByZWRpY2F0ZTtcbn1cbiJdfQ==
@@ -0,0 +1,203 @@
1
+ import * as cdk from 'aws-cdk-lib/core';
2
+ import * as constructs from 'constructs';
3
+ import { CfnTrigger } from 'aws-cdk-lib/aws-glue';
4
+ import { OnDemandTriggerOptions, WeeklyScheduleTriggerOptions, DailyScheduleTriggerOptions, CustomScheduledTriggerOptions, NotifyEventTriggerOptions, ConditionalTriggerOptions } from './trigger-options';
5
+ /**
6
+ * The base interface for Glue Workflow
7
+ *
8
+ * @see {@link Workflow}
9
+ * @see https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html
10
+ */
11
+ export interface IWorkflow extends cdk.IResource {
12
+ /**
13
+ * The name of the workflow
14
+ * @attribute
15
+ */
16
+ readonly workflowName: string;
17
+ /**
18
+ * The ARN of the workflow
19
+ * @attribute
20
+ */
21
+ readonly workflowArn: string;
22
+ /**
23
+ * Add an on-demand trigger to the workflow
24
+ */
25
+ addOnDemandTrigger(id: string, options: OnDemandTriggerOptions): CfnTrigger;
26
+ /**
27
+ * Add an daily-scheduled trigger to the workflow
28
+ */
29
+ addDailyScheduledTrigger(id: string, options: DailyScheduleTriggerOptions): CfnTrigger;
30
+ /**
31
+ * Add an weekly-scheduled trigger to the workflow
32
+ */
33
+ addWeeklyScheduledTrigger(id: string, options: WeeklyScheduleTriggerOptions): CfnTrigger;
34
+ /**
35
+ * Add an custom-scheduled trigger to the workflow
36
+ */
37
+ addCustomScheduledTrigger(id: string, options: CustomScheduledTriggerOptions): CfnTrigger;
38
+ }
39
+ /**
40
+ * Properties for importing a Workflow using its attributes
41
+ */
42
+ export interface WorkflowAttributes {
43
+ /**
44
+ * The name of the workflow to import
45
+ */
46
+ readonly workflowName: string;
47
+ /**
48
+ * The ARN of the workflow to import
49
+ *
50
+ * @default - derived from the workflow name
51
+ */
52
+ readonly workflowArn?: string;
53
+ }
54
+ /**
55
+ * Properties for defining a Workflow
56
+ */
57
+ export interface WorkflowProps {
58
+ /**
59
+ * Name of the workflow
60
+ *
61
+ * @default - a name will be generated
62
+ */
63
+ readonly workflowName?: string;
64
+ /**
65
+ * A description of the workflow
66
+ *
67
+ * @default - no description
68
+ */
69
+ readonly description?: string;
70
+ /**
71
+ * A map of properties to use when this workflow is executed
72
+ *
73
+ * @default - no default run properties
74
+ */
75
+ readonly defaultRunProperties?: {
76
+ [key: string]: string;
77
+ };
78
+ /**
79
+ * The maximum number of concurrent runs allowed for the workflow
80
+ *
81
+ * @default - no limit
82
+ */
83
+ readonly maxConcurrentRuns?: number;
84
+ }
85
+ /**
86
+ * Base abstract class for Workflow
87
+ *
88
+ * @see https://docs.aws.amazon.com/glue/latest/dg/about-triggers.html
89
+ */
90
+ export declare abstract class WorkflowBase extends cdk.Resource implements IWorkflow {
91
+ /**
92
+ * Extract workflowName from arn
93
+ */
94
+ protected static extractNameFromArn(scope: constructs.Construct, workflowArn: string): string;
95
+ abstract readonly workflowName: string;
96
+ abstract readonly workflowArn: string;
97
+ /**
98
+ * Add an on-demand trigger to the workflow.
99
+ *
100
+ * @param id The id of the trigger.
101
+ * @param options Additional options for the trigger.
102
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided.
103
+ * @returns The created CfnTrigger resource.
104
+ */
105
+ addOnDemandTrigger(id: string, options: OnDemandTriggerOptions): CfnTrigger;
106
+ /**
107
+ * Add a daily-scheduled trigger to the workflow.
108
+ *
109
+ * @param id The id of the trigger.
110
+ * @param options Additional options for the trigger.
111
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided.
112
+ * @returns The created CfnTrigger resource.
113
+ */
114
+ addDailyScheduledTrigger(id: string, options: DailyScheduleTriggerOptions): CfnTrigger;
115
+ /**
116
+ * Add a weekly-scheduled trigger to the workflow.
117
+ *
118
+ * @param id The id of the trigger.
119
+ * @param options Additional options for the trigger.
120
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided.
121
+ * @returns The created CfnTrigger resource.
122
+ */
123
+ addWeeklyScheduledTrigger(id: string, options: WeeklyScheduleTriggerOptions): CfnTrigger;
124
+ /**
125
+ * Add a custom-scheduled trigger to the workflow.
126
+ *
127
+ * @param id The id of the trigger.
128
+ * @param options Additional options for the trigger.
129
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided.
130
+ * @returns The created CfnTrigger resource.
131
+ */
132
+ addCustomScheduledTrigger(id: string, options: CustomScheduledTriggerOptions): CfnTrigger;
133
+ /**
134
+ * Add an Event Bridge based trigger to the workflow.
135
+ *
136
+ * @param id The id of the trigger.
137
+ * @param options Additional options for the trigger.
138
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided.
139
+ * @returns The created CfnTrigger resource.
140
+ */
141
+ addNotifyEventTrigger(id: string, options: NotifyEventTriggerOptions): CfnTrigger;
142
+ /**
143
+ * Add a Condition (Predicate) based trigger to the workflow.
144
+ *
145
+ * @param id The id of the trigger.
146
+ * @param options Additional options for the trigger.
147
+ * @throws If both job and crawler are provided, or if neither job nor crawler is provided for any condition.
148
+ * @throws If a job is provided without a job state, or if a crawler is provided without a crawler state for any condition.
149
+ * @returns The created CfnTrigger resource.
150
+ */
151
+ addconditionalTrigger(id: string, options: ConditionalTriggerOptions): CfnTrigger;
152
+ private renderAction;
153
+ private renderPredicate;
154
+ private renderEventBatchingCondition;
155
+ protected buildWorkflowArn(scope: constructs.Construct, workflowName: string): string;
156
+ }
157
+ /**
158
+ * This module defines a construct for creating and managing AWS Glue Workflows and Triggers.
159
+ *
160
+ * AWS Glue Workflows are orchestration services that allow you to create, manage, and monitor complex extract, transform, and load (ETL) activities involving multiple crawlers, jobs, and triggers. Workflows are designed to allow you to manage interdependent jobs and crawlers as a single unit, making it easier to orchestrate and monitor complex ETL pipelines.
161
+ *
162
+ * Triggers are used to initiate an AWS Glue Workflow. You can configure different types of triggers, such as on-demand, scheduled, event-based, or conditional triggers, to start your Workflow based on specific conditions or events.
163
+ *
164
+ * @see https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html
165
+ * @see https://docs.aws.amazon.com/glue/latest/dg/about-triggers.html
166
+ *
167
+ * ## Usage Example
168
+ *
169
+ * ```ts
170
+ * const app = new App();
171
+ * const stack = new Stack(app, 'TestStack');
172
+ *
173
+ * // Create a Glue Job
174
+ * declare const role: iam.IRole;
175
+ * declare const script: glue.Code;
176
+ * const job = new glue.PySparkStreamingJob(stack, 'ImportedJob', { role, script });
177
+ *
178
+ * // Create a Glue Workflow
179
+ * const workflow = new glue.Workflow(stack, 'TestWorkflow');
180
+ *
181
+ * // Add an on-demand trigger to the Workflow
182
+ * workflow.addOnDemandTrigger('OnDemandTrigger', {
183
+ * actions: [{ job: job }],
184
+ * });
185
+ * ```
186
+ */
187
+ export declare class Workflow extends WorkflowBase {
188
+ /**
189
+ * Import a workflow from its name
190
+ */
191
+ static fromWorkflowName(scope: constructs.Construct, id: string, workflowName: string): IWorkflow;
192
+ /**
193
+ * Import an workflow from it's name
194
+ */
195
+ static fromWorkflowArn(scope: constructs.Construct, id: string, workflowArn: string): IWorkflow;
196
+ /**
197
+ * Import an existing workflow
198
+ */
199
+ static fromWorkflowAttributes(scope: constructs.Construct, id: string, attrs: WorkflowAttributes): IWorkflow;
200
+ readonly workflowName: string;
201
+ readonly workflowArn: string;
202
+ constructor(scope: constructs.Construct, id: string, props?: WorkflowProps);
203
+ }