Closed
Description
What is the problem?
A CallAwsService
task with a CodeBuild startBuild
action and IntegrationPattern.RUN_JOB
fails on deploy with SCHEMA_VALIDATION_FAILED: The resource provided arn:aws:states:::aws-sdk:codebuild:startBuild.sync is not recognized.
An equivalent CodeBuildStartBuild
task deploys as expected. Note the aws-sdk:
portion of the ARN, which appears to be invalid State Machine syntax for the RUN_JOB
pattern:
Task Construct | Pattern | CDK-generated Resource Arn Stub | Deploys? |
---|---|---|---|
CallAwsService | RUN_JOB | arn:aws:states:::aws-sdk:codebuild:startBuild.sync |
❌ |
CallAwsService | REQUEST_RESPONSE | arn:aws:states:::aws-sdk:codebuild:startBuild |
✅ |
CodeBuildStartBuild | RUN_JOB | arn:aws:states:::codebuild:startBuild.sync |
✅ |
CodeBuildStartBuild | REQUEST_RESPONSE | arn:aws:states:::codebuild:startBuild |
✅ |
Reproduction Steps
Two equivalent constructs to start a CodeBuild build:
const callAwsTask = new tasks.CallAwsService(this, 'CallAwsTask', {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
service: 'codebuild',
action: 'startBuild',
parameters: {
ProjectName: project.projectName,
},
iamResources: [project.projectArn],
});
const startBuildTask = new tasks.CodeBuildStartBuild(this, 'StartBuildTask', {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
project,
});
What did you expect to happen?
Expected the two constructs to deploy successfully.
What actually happened?
The CallAwsService
task fails to deploy with RUN_JOB
integration.
SCHEMA_VALIDATION_FAILED: The resource provided arn:aws:states:::aws-sdk:codebuild:startBuild.sync is not recognized.
CDK CLI Version
2.14.0
Framework Version
No response
Node.js Version
14
OS
macos
Language
Typescript
Language Version
4.5.5
Other information
No response
Activity
jogold commentedon Feb 28, 2022
The
RUN_JOB
integration pattern is not supported for AWS SDK service integration.See https://docs.aws.amazon.com/step-functions/latest/dg/supported-services-awssdk.html
The code should throw in this case.
fix(stepfunctions-tasks): RUN_JOB integration pattern not supported f…
fedonev commentedon Feb 28, 2022
@jogold Thanks for the quick response. Having dug deeper, my current understanding is:
CallAwsService
implements AWS SDK service integrations. Resource ARNs start witharn:aws:states:::aws-sdk:
aws_stepfunctions_tasks
implement Optimised Integrations. Resource ARNs start witharn:aws:states:::
I did not previously see this correspondence. But I now see your PR adding
CallAwsService
is literally titled "feat(stepfunctions-tasks): AWS SDK service integrations" (thanks!). What led me astray is that the two Step Function terms-of-art -- "AWS SDK service integrations" and "Optimized Integrations" -- do not seem to appear in the CDK docs.Is my understanding correct?
jogold commentedon Feb 28, 2022
@fedonev yes, you are correct.
You can find the term "AWS SDK integration" in the tasks doc at https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-stepfunctions-tasks#aws-sdk.
The term "optimized" is indeed nowhere to be found.
fix(stepfunctions-tasks): RUN_JOB integration pattern not supported f…
github-actions commentedon Feb 28, 2022
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
fix(stepfunctions-tasks): RUN_JOB integration pattern not supported f…