-
Notifications
You must be signed in to change notification settings - Fork 4k
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
StepFunctions: Integration pattern RUN_JOB has no effect on GlueStartJobRun #30735
Comments
Run a Job (.sync) specifies that @lauragalera Good morning. Somehow, I'm unable to reproduce the issue at my end using CDK version import * as cdk from 'aws-cdk-lib';
import { DefinitionBody, Fail, IntegrationPattern, StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
import { GlueStartJobRun } from 'aws-cdk-lib/aws-stepfunctions-tasks';
import { Construct } from 'constructs';
export class Issue30735Stack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const jobIngestionMixpanel = new GlueStartJobRun(this, 'StartJobIngestionMixpanel', {
glueJobName: 'JOB-00348-DEV-mixpanel-events-to-s3',
integrationPattern: IntegrationPattern.RUN_JOB
})
jobIngestionMixpanel.addRetry({
errors: ['States.TaskFailed'],
backoffRate: 1,
maxAttempts: 2,
interval: cdk.Duration.minutes(5)
})
jobIngestionMixpanel.addCatch(new Fail(this, 'JobFailed', {
error: 'Glue job failed after retries'
}))
const jobRedshiftMixpanel = new GlueStartJobRun(this, 'StartJobRedshiftMixpanel', {
glueJobName: 'JOB-00351-DEV-mixpanel-events-to-redshift'
})
const definition = jobIngestionMixpanel.next(jobRedshiftMixpanel)
new StateMachine(this, 'StateMachineJobs', {
definitionBody: DefinitionBody.fromChainable(definition)
})
}
} generated the State Machine job with the below definition (notice the 1st Task has {
"StartAt": "StartJobIngestionMixpanel",
"States": {
"StartJobIngestionMixpanel": {
"Next": "StartJobRedshiftMixpanel",
"Retry": [
{
"ErrorEquals": [
"States.TaskFailed"
],
"IntervalSeconds": 300,
"MaxAttempts": 2,
"BackoffRate": 1
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "JobFailed"
}
],
"Type": "Task",
"Resource": "arn:aws:states:::glue:startJobRun.sync",
"Parameters": {
"JobName": "JOB-00348-DEV-mixpanel-events-to-s3"
}
},
"StartJobRedshiftMixpanel": {
"End": true,
"Type": "Task",
"Resource": "arn:aws:states:::glue:startJobRun",
"Parameters": {
"JobName": "JOB-00351-DEV-mixpanel-events-to-redshift"
}
},
"JobFailed": {
"Type": "Fail",
"Error": "Glue job failed after retries"
}
}
} Please try using the latest Thanks, |
Hello @ashishdhingra, Indeed, changing to version 2.147.3 solved it. Thank you |
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
There is a feature in console that permits to execute two jobs sequentially by enabling "Wait for task to complete - optional" in the GlueStartJobRun. I found in a closed issue that the same behavior can be achieved by using the construct property
IntegrationPattern.RUN_JOB
. However, cdk ignores the property because, after deploying, the resource appears without the sufix.sync
.Expected Behavior
The deployment should result in a state machine with the following code (notice the .sync):
Current Behavior
The resulting code:
Reproduction Steps
Code for replication
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.126.0
Framework Version
No response
Node.js Version
v20.11.0
OS
MacOS 14.2.1
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: