Skip to content

Commit 4b134b7

Browse files
authored
fix(stepfunctions-tasks): RUN_JOB integration pattern not supported for CallAwsService (#19186)
It is only supported for AWS Batch and Amazon ECS. Throw when used for CallAwsService. Closes #19174 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5c40b90 commit 4b134b7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/@aws-cdk/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export class CallAwsService extends sfn.TaskStateBase {
6464
constructor(scope: Construct, id: string, private readonly props: CallAwsServiceProps) {
6565
super(scope, id, props);
6666

67+
if (this.props.integrationPattern === sfn.IntegrationPattern.RUN_JOB) {
68+
throw new Error('The RUN_JOB integration pattern is not supported for CallAwsService');
69+
}
70+
6771
this.taskPolicies = [
6872
new iam.PolicyStatement({
6973
resources: props.iamResources,

packages/@aws-cdk/aws-stepfunctions-tasks/test/aws-sdk/call-aws-service.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,16 @@ test('with unresolved tokens', () => {
146146
Parameters: {},
147147
});
148148
});
149+
150+
test('throws with invalid integration pattern', () => {
151+
expect(() => new tasks.CallAwsService(stack, 'GetObject', {
152+
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
153+
service: 's3',
154+
action: 'getObject',
155+
parameters: {
156+
Bucket: 'my-bucket',
157+
Key: sfn.JsonPath.stringAt('$.key'),
158+
},
159+
iamResources: ['*'],
160+
})).toThrow(/The RUN_JOB integration pattern is not supported for CallAwsService/);
161+
});

0 commit comments

Comments
 (0)