aws / aws/aws-cdk

apigatewayv2: stateMachineArn does not fit schema for Operation: StepFunctions-StartSyncExecution

Open
#26,328 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-apigatewayv2 bug effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

I'm trying to create a ApiGatewayV2 route with AWS StepFunction integration. For this I'm using the L1 constructs but getting the following error message:

```shell
UPDATE_ROLLBACK_COMPLETE: Parameter: stateMachineArn does not fit schema for Operation: StepFunctions-StartSyncExecution. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException
```

### Expected Behavior

The creation of the ApiGatewayV2 route with an AWS StepFunction integration

### Current Behavior

Stack deployment failure and rollbacked:

```shell
UPDATE_ROLLBACK_COMPLETE: Parameter: stateMachineArn does not fit schema for Operation: StepFunctions-StartSyncExecution. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException
```

### Reproduction Steps

```typescript
const demoStateMachine = new StateMachine(scope, 'DemoStateMachine', {
stateMachineType: StateMachineType.EXPRESS,
definitionBody:
DefinitionBody.fromChainable(
new Pass(scope, 'PassState')
),
});

const role = new Role(scope, 'DemoStateMachineRole', {
assumedBy: new ServicePrincipal('apigateway.amazonaws.com'),
});

const integration = new CfnIntegration(
this.scope,
"DemoStateMachineIntegration",
{
apiId: gateway.httpApiId,
integrationType: HttpIntegrationType.AWS_PROXY,
integrationSubtype: 'StepFunctions-StartSyncExecution',
credentialsArn: role.roleArn,
payloadFormatVersion: PayloadFormatVersion.VERSION_1_0.version,
requestParameters: {
stateMachineArn: demoStateMachine.stateMachineArn
}
}
);

new CfnRoute(this.scope, 'CheckoutRoute', {
apiId: gateway.httpApiId,
routeKey: `${HttpMethod.POST} demo`,
authorizationType: 'NONE',
target: `integrations/${integration.ref}`,
});

```

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.85.0

### Framework Version

2.85.0

### Node.js Version

16.18.0

### OS

macOS 13.4.1

### Language

Typescript

### Language Version

4.9.5

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the shown TypeScript configuration using CfnIntegration and CfnRoute, focusing on requestParameters for StepFunctions-StartSyncExecution. Investigate why stateMachineArn is rejected during deployment; done means the stack deploys successfully and creates the ApiGatewayV2 route with the Step Functions integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.