Skip to content

(stepfunctions-tasks): CallAwsService produces invalid .sync Resource Arn (codebuild.startBuild action) #19174

Closed
@fedonev

Description

@fedonev

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

added
bugThis issue is a bug.
needs-triageThis issue or PR still needs to be triaged.
on Feb 26, 2022
jogold

jogold commented on Feb 28, 2022

@jogold
Contributor

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.

added a commit that references this issue on Feb 28, 2022
0e2d97b
fedonev

fedonev commented on Feb 28, 2022

@fedonev
Author

@jogold Thanks for the quick response. Having dug deeper, my current understanding is:

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

jogold commented on Feb 28, 2022

@jogold
Contributor

@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.

added
effort/smallSmall work item – less than a day of effort
and removed
needs-triageThis issue or PR still needs to be triaged.
on Feb 28, 2022
removed their assignment
on Feb 28, 2022
added a commit that references this issue on Feb 28, 2022
4b134b7
github-actions

github-actions commented on Feb 28, 2022

@github-actions
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

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.

added a commit that references this issue on Mar 11, 2022
1c30378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @fedonev@jogold@kaizencc

      Issue actions

        (stepfunctions-tasks): `CallAwsService` produces invalid `.sync` Resource Arn (`codebuild.startBuild` action) · Issue #19174 · aws/aws-cdk