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

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

Closed
fedonev opened this issue Feb 26, 2022 · 4 comments · Fixed by #19186
Labels
@aws-cdk/aws-stepfunctions-tasks bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@fedonev
Copy link

fedonev commented Feb 26, 2022

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

@fedonev fedonev added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 26, 2022
@jogold
Copy link
Contributor

jogold commented 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.

jogold added a commit to jogold/aws-cdk that referenced this issue Feb 28, 2022
…or CallAwsService

It is only supported for AWS Batch and Amazon ECS.

Throw when used for CallAwsService.

Closes aws#19174
@fedonev
Copy link
Author

fedonev commented Feb 28, 2022

@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
Copy link
Contributor

jogold commented 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.

@kaizencc kaizencc added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 28, 2022
@kaizencc kaizencc removed their assignment Feb 28, 2022
@mergify mergify bot closed this as completed in #19186 Feb 28, 2022
mergify bot pushed a commit that referenced this issue Feb 28, 2022
…or 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*
@github-actions
Copy link

⚠️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.

TheRealAmazonKendra pushed a commit to TheRealAmazonKendra/aws-cdk that referenced this issue Mar 11, 2022
…or CallAwsService (aws#19186)

It is only supported for AWS Batch and Amazon ECS.

Throw when used for CallAwsService.

Closes aws#19174


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions-tasks bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
3 participants