Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(glue): --conf parameter is no longer a reserved keyword for glue jobs #23673

Merged
merged 3 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue/lib/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ export class Job extends JobBase {
*/
private checkNoReservedArgs(defaultArguments?: { [key: string]: string }) {
if (defaultArguments) {
const reservedArgs = new Set(['--conf', '--debug', '--mode', '--JOB_NAME']);
const reservedArgs = new Set(['--debug', '--mode', '--JOB_NAME']);
Object.keys(defaultArguments).forEach((arg) => {
if (reservedArgs.has(arg)) {
throw new Error(`The ${arg} argument is reserved by Glue. Don't set it`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "22.0.0",
"version": "29.0.0",
"files": {
"432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855": {
"source": {
Expand All @@ -14,15 +14,15 @@
}
}
},
"0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4": {
"977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2": {
"source": {
"path": "aws-glue-job.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json",
"objectKey": "977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"ExecutionProperty": {
"MaxConcurrentRuns": 2
Expand Down Expand Up @@ -527,7 +528,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"ExecutionProperty": {
"MaxConcurrentRuns": 2
Expand Down Expand Up @@ -881,7 +883,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"ExecutionProperty": {
"MaxConcurrentRuns": 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"22.0.0"}
{"version":"29.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "22.0.0",
"version": "29.0.0",
"testCases": {
"integ.job": {
"stacks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "22.0.0",
"version": "29.0.0",
"artifacts": {
"aws-glue-job.assets": {
"type": "cdk:asset-manifest",
Expand All @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/977a2f07e22679bb04b03ce83cc1fac3e6cc269a794e38248ec67106ee39f0a2.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -224,78 +224,6 @@
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
],
"EtlJobServiceRole837F781B": [
{
"type": "aws:cdk:logicalId",
"data": "EtlJobServiceRole837F781B",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"EtlJobServiceRoleDefaultPolicy8BFE343B": [
{
"type": "aws:cdk:logicalId",
"data": "EtlJobServiceRoleDefaultPolicy8BFE343B",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"EtlJobSparkUIBucketBF23744B": [
{
"type": "aws:cdk:logicalId",
"data": "EtlJobSparkUIBucketBF23744B",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"EtlJob7FC88E45": [
{
"type": "aws:cdk:logicalId",
"data": "EtlJob7FC88E45",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"EtlJobSuccessMetricRuleA72A3EF6": [
{
"type": "aws:cdk:logicalId",
"data": "EtlJobSuccessMetricRuleA72A3EF6",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"StreamingJobServiceRole1B4B8BF9": [
{
"type": "aws:cdk:logicalId",
"data": "StreamingJobServiceRole1B4B8BF9",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"StreamingJobServiceRoleDefaultPolicyA0CC4C68": [
{
"type": "aws:cdk:logicalId",
"data": "StreamingJobServiceRoleDefaultPolicyA0CC4C68",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
],
"StreamingJob3783CC17": [
{
"type": "aws:cdk:logicalId",
"data": "StreamingJob3783CC17",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
]
},
"displayName": "aws-glue-job"
Expand Down
21 changes: 12 additions & 9 deletions packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,21 @@
"version": "0.0.0"
}
},
"Code93a4952ea654434aca8481fb2bc2a836": {
"id": "Code93a4952ea654434aca8481fb2bc2a836",
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836",
"Codebeaf1c9f157c9b396ec6972f85317dbc": {
"id": "Codebeaf1c9f157c9b396ec6972f85317dbc",
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc",
"children": {
"Stage": {
"id": "Stage",
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/Stage",
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/Stage",
"constructInfo": {
"fqn": "@aws-cdk/core.AssetStaging",
"version": "0.0.0"
}
},
"AssetBucket": {
"id": "AssetBucket",
"path": "aws-glue-job/EtlJob2.0/Code93a4952ea654434aca8481fb2bc2a836/AssetBucket",
"path": "aws-glue-job/EtlJob2.0/Codebeaf1c9f157c9b396ec6972f85317dbc/AssetBucket",
"constructInfo": {
"fqn": "@aws-cdk/aws-s3.BucketBase",
"version": "0.0.0"
Expand Down Expand Up @@ -275,7 +275,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"executionProperty": {
"maxConcurrentRuns": 2
Expand Down Expand Up @@ -788,7 +789,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"executionProperty": {
"maxConcurrentRuns": 2
Expand Down Expand Up @@ -1301,7 +1303,8 @@
]
},
"arg1": "value1",
"arg2": "value2"
"arg2": "value2",
"--conf": "valueConf"
},
"executionProperty": {
"maxConcurrentRuns": 2
Expand Down Expand Up @@ -1974,7 +1977,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.168"
"version": "10.1.209"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions packages/@aws-cdk/aws-glue/test/integ.job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ const script = glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.
timeout: cdk.Duration.minutes(5),
notifyDelayAfter: cdk.Duration.minutes(1),
defaultArguments: {
arg1: 'value1',
arg2: 'value2',
'arg1': 'value1',
'arg2': 'value2',
'--conf': 'valueConf',
},
sparkUI: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue/test/job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ describe('Job', () => {
});

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

Expand Down