Skip to content

Commit 3d0f4ba

Browse files
authored
fix(glue): --conf parameter is no longer a reserved keyword for glue jobs (#23673)
AWS Glue has changed its public description for the job parameter `--conf`. The latest description: https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html > Controls Spark config parameters. It is for advanced use cases. According to this change, AWS CDK no longer needs to block the usage of this parameter. This PR removes the validation for the parameter `--conf`. ## Background The parameter `--conf` is expected to use several Spark capabilities. One of the typical usage is with native data lake table format support. https://aws.amazon.com/about-aws/whats-new/2022/11/aws-glue-apache-spark-native-data-lake-frameworks-apache-hudi-iceberg-delta-lake/ Public sample notebooks (e.g. https://github.com/aws-samples/aws-glue-samples/blob/master/examples/notebooks/native_hudi_sql.ipynb) use the parameter `--conf`. ---- ### All Submissions: * [ x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f5a3a29 commit 3d0f4ba

File tree

9 files changed

+30
-95
lines changed

9 files changed

+30
-95
lines changed

packages/@aws-cdk/aws-glue/lib/job.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ export class Job extends JobBase {
692692
*/
693693
private checkNoReservedArgs(defaultArguments?: { [key: string]: string }) {
694694
if (defaultArguments) {
695-
const reservedArgs = new Set(['--conf', '--debug', '--mode', '--JOB_NAME']);
695+
const reservedArgs = new Set(['--debug', '--mode', '--JOB_NAME']);
696696
Object.keys(defaultArguments).forEach((arg) => {
697697
if (reservedArgs.has(arg)) {
698698
throw new Error(`The ${arg} argument is reserved by Glue. Don't set it`);

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"files": {
44
"432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855": {
55
"source": {
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4": {
17+
"977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2": {
1818
"source": {
1919
"path": "aws-glue-job.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json",
25+
"objectKey": "977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.template.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
]
174174
},
175175
"arg1": "value1",
176-
"arg2": "value2"
176+
"arg2": "value2",
177+
"--conf": "valueConf"
177178
},
178179
"ExecutionProperty": {
179180
"MaxConcurrentRuns": 2
@@ -527,7 +528,8 @@
527528
]
528529
},
529530
"arg1": "value1",
530-
"arg2": "value2"
531+
"arg2": "value2",
532+
"--conf": "valueConf"
531533
},
532534
"ExecutionProperty": {
533535
"MaxConcurrentRuns": 2
@@ -881,7 +883,8 @@
881883
]
882884
},
883885
"arg1": "value1",
884-
"arg2": "value2"
886+
"arg2": "value2",
887+
"--conf": "valueConf"
885888
},
886889
"ExecutionProperty": {
887890
"MaxConcurrentRuns": 2
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"22.0.0"}
1+
{"version":"29.0.0"}

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"testCases": {
44
"integ.job": {
55
"stacks": [

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/manifest.json

+2-74
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"artifacts": {
44
"aws-glue-job.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [
@@ -224,78 +224,6 @@
224224
"type": "aws:cdk:logicalId",
225225
"data": "CheckBootstrapVersion"
226226
}
227-
],
228-
"EtlJobServiceRole837F781B": [
229-
{
230-
"type": "aws:cdk:logicalId",
231-
"data": "EtlJobServiceRole837F781B",
232-
"trace": [
233-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
234-
]
235-
}
236-
],
237-
"EtlJobServiceRoleDefaultPolicy8BFE343B": [
238-
{
239-
"type": "aws:cdk:logicalId",
240-
"data": "EtlJobServiceRoleDefaultPolicy8BFE343B",
241-
"trace": [
242-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
243-
]
244-
}
245-
],
246-
"EtlJobSparkUIBucketBF23744B": [
247-
{
248-
"type": "aws:cdk:logicalId",
249-
"data": "EtlJobSparkUIBucketBF23744B",
250-
"trace": [
251-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
252-
]
253-
}
254-
],
255-
"EtlJob7FC88E45": [
256-
{
257-
"type": "aws:cdk:logicalId",
258-
"data": "EtlJob7FC88E45",
259-
"trace": [
260-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
261-
]
262-
}
263-
],
264-
"EtlJobSuccessMetricRuleA72A3EF6": [
265-
{
266-
"type": "aws:cdk:logicalId",
267-
"data": "EtlJobSuccessMetricRuleA72A3EF6",
268-
"trace": [
269-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
270-
]
271-
}
272-
],
273-
"StreamingJobServiceRole1B4B8BF9": [
274-
{
275-
"type": "aws:cdk:logicalId",
276-
"data": "StreamingJobServiceRole1B4B8BF9",
277-
"trace": [
278-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
279-
]
280-
}
281-
],
282-
"StreamingJobServiceRoleDefaultPolicyA0CC4C68": [
283-
{
284-
"type": "aws:cdk:logicalId",
285-
"data": "StreamingJobServiceRoleDefaultPolicyA0CC4C68",
286-
"trace": [
287-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
288-
]
289-
}
290-
],
291-
"StreamingJob3783CC17": [
292-
{
293-
"type": "aws:cdk:logicalId",
294-
"data": "StreamingJob3783CC17",
295-
"trace": [
296-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
297-
]
298-
}
299227
]
300228
},
301229
"displayName": "aws-glue-job"

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,21 @@
203203
"version": "0.0.0"
204204
}
205205
},
206-
"Code93a4952ea654434aca8481fb2bc2a836": {
207-
"id": "Code93a4952ea654434aca8481fb2bc2a836",
208-
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836",
206+
"Codebeaf1c9f157c9b396ec6972f85317dbc": {
207+
"id": "Codebeaf1c9f157c9b396ec6972f85317dbc",
208+
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc",
209209
"children": {
210210
"Stage": {
211211
"id": "Stage",
212-
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/Stage",
212+
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/Stage",
213213
"constructInfo": {
214214
"fqn": "@aws-cdk/core.AssetStaging",
215215
"version": "0.0.0"
216216
}
217217
},
218218
"AssetBucket": {
219219
"id": "AssetBucket",
220-
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/AssetBucket",
220+
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/AssetBucket",
221221
"constructInfo": {
222222
"fqn": "@aws-cdk/aws-s3.BucketBase",
223223
"version": "0.0.0"
@@ -275,7 +275,8 @@
275275
]
276276
},
277277
"arg1": "value1",
278-
"arg2": "value2"
278+
"arg2": "value2",
279+
"--conf": "valueConf"
279280
},
280281
"executionProperty": {
281282
"maxConcurrentRuns": 2
@@ -788,7 +789,8 @@
788789
]
789790
},
790791
"arg1": "value1",
791-
"arg2": "value2"
792+
"arg2": "value2",
793+
"--conf": "valueConf"
792794
},
793795
"executionProperty": {
794796
"maxConcurrentRuns": 2
@@ -1301,7 +1303,8 @@
13011303
]
13021304
},
13031305
"arg1": "value1",
1304-
"arg2": "value2"
1306+
"arg2": "value2",
1307+
"--conf": "valueConf"
13051308
},
13061309
"executionProperty": {
13071310
"maxConcurrentRuns": 2
@@ -1974,7 +1977,7 @@
19741977
"path": "Tree",
19751978
"constructInfo": {
19761979
"fqn": "constructs.Construct",
1977-
"version": "10.1.168"
1980+
"version": "10.1.209"
19781981
}
19791982
}
19801983
},

packages/@aws-cdk/aws-glue/test/integ.job.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ const script = glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.
3838
timeout: cdk.Duration.minutes(5),
3939
notifyDelayAfter: cdk.Duration.minutes(1),
4040
defaultArguments: {
41-
arg1: 'value1',
42-
arg2: 'value2',
41+
'arg1': 'value1',
42+
'arg2': 'value2',
43+
'--conf': 'valueConf',
4344
},
4445
sparkUI: {
4546
enabled: true,

packages/@aws-cdk/aws-glue/test/job.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ describe('Job', () => {
566566
});
567567

568568
test('with reserved args should throw', () => {
569-
['--conf', '--debug', '--mode', '--JOB_NAME'].forEach((arg, index) => {
569+
['--debug', '--mode', '--JOB_NAME'].forEach((arg, index) => {
570570
const defaultArguments: {[key: string]: string} = {};
571571
defaultArguments[arg] = 'random value';
572572

0 commit comments

Comments
 (0)