aws / aws/serverless-application-model

Cannot set HttpApi Event Type on AWS::Serverless::StateMachine

Open
#1,851 6 comments 6 reactions 0 assignees View on GitHub
area/step-function area/step-function/event-source maintainer/need-response stage/pm-review type/feature type/step-function/new-event-source
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

I'm attempting to configure step functions to be triggered from an HttpApi (rather than a REST api). Here is my template:

```
APIGatewayDeployment:
Type: AWS::Serverless::HttpApi
Properties:
StageName: !Ref pStage
DefinitionBody:
info:
title: !Ref AWS::StackName
version: "1.0"
openapi: 3.0.1

MyStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
DefinitionUri: statemachines/MyStateMachine.asl.json
DefinitionSubstitutions:
MyFunction: !GetAtt MyFunction.Arn
Events:
HttpAPIGateway:
Type: HttpApi
Properties:
Path: /inbound
Method: post
ApiId: !Ref APIGatewayDeployment
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref MyFunction
```

This builds, but fails validation or deployment with the following:
`Error: Failed to create changeset for the stack: , ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyStateMachine] is invalid. Event with id [HttpAPIGateway] is invalid. Resource dict has missing or invalid value for key Type. Event Type is: HttpApi.`

If I've done something wrong, let me know! I've been unable to find helpful documentation about using HTTP rather than REST with step functions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.