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

gefragt vor 3 Jahren510 Aufrufe
2 Antworten
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.

beantwortet vor 3 Jahren
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!

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen