Can't seem to create an ApiGatewayV2 integration correctly

0

I'm trying to create an ApiGatewayV2 integration to call StepFunctions StartExecution. It says it's supported here:
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html#StepFunctions-StartExecution

In my CloudFormation template I have this:

StepFunctionTriggerApi:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: video-podcast-sfn-trigger
ProtocolType: HTTP
StepFunctionTriggerApiIntegration:
Type: AWS::ApiGatewayV2::Integration
Properties:
ApiId: !Ref StepFunctionTriggerApi
IntegrationType: AWS_PROXY
IntegrationSubtype: StepFunctions-StartExecution
PayloadFormatVersion: 1.0
CredentialsArn: !GetAtt [StepFunctionTriggerRole, Arn]
RequestParameters:
Input: $request.body
StateMachineArn: !Ref MyStateMachine

I get the error "An error occurred: StepFunctionTriggerApiIntegration - Operation: StepFunctions-StartExecution is not supported."

Oddly enough, the same request (as far as I can tell) from the CLI works:

aws apigatewayv2 create-integration \
--api-id kxlec4gihb \
--integration-subtype StepFunctions-StartExecution \
--integration-type AWS_PROXY \
--payload-format-version 1.0 \
--credentials-arn arn:aws:iam::... \
--request-parameters '{"StateMachineArn": "arn:aws:states:..."}'

Edited by: taschmidt on Apr 16, 2021 7:55 AM

Edited by: taschmidt on Apr 16, 2021 7:56 AM

Edited by: taschmidt on Apr 16, 2021 7:58 AM

Edited by: taschmidt on Apr 16, 2021 7:58 AM

Edited by: taschmidt on Apr 16, 2021 7:59 AM

asked 3 years ago495 views
2 Answers
1

Ok I believe I found the problem. I'm using Serverless and the value for PayloadFormatVersion (since it wasn't quoted) was getting converted to "1" (just a primitive integer) in the resulting CloudFormation template. If I put quotes around it like '1.0' it stayed a string literal and it appears to be working.

answered 3 years ago
0

Apologies for the (lack of) formatting. I can't seem to figure out how to format in here. It says there's a "preview" tab but I don't see one!

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions