-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
area/api-integrationarea/local/start-apisam local start-api commandsam local start-api commandstage/waiting-for-releaseFix has been merged to develop and is waiting for a releaseFix has been merged to develop and is waiting for a releasetype/featureFeature requestFeature request
Description
AWS Lambda and API Gateway support response streaming as documented in the AWS blog post
https://aws.amazon.com/blogs/compute/building-responsive-apis-with-amazon-api-gateway-response-streaming/
However, this feature is not available through SAM "Api" events
I wish sam cli should support InvokeMode: RESPONSE_STREAM
The cloud formation and cli is already supporting this property.
Code not working:
`
ApiHandlerFun:
Type: AWS::Serverless::Function
Properties:
CodeUri: apis-lambda/src
Handler: ApiHandlerLambda.lambda_handler
FunctionName: !Sub "${Stage}-ApiHandlerFun"
Environment:
Variables:
AGENT_ID: !Ref AgentId
AGENT_ALIAS_NAME: !Ref AgentAliasName
Events:
ChatStreamEventMessage:
Type: Api
Properties:
RestApiId: !Ref ChatbotRestApi
Path: /converse-stream
Method: POST
InvokeMode: RESPONSE_STREAM # Enable streaming
`
If I add above property (InvokeMode: RESPONSE_STREAM ) and run aws sam command then getting exception:
Number of errors found: 1. Resource with id [ChatStreamEventMessage] is invalid. property InvokeMode not defined for resource of type Api
SAM CLI Version: SAM CLI, version 1.144.0
Python Version:3.13
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/api-integrationarea/local/start-apisam local start-api commandsam local start-api commandstage/waiting-for-releaseFix has been merged to develop and is waiting for a releaseFix has been merged to develop and is waiting for a releasetype/featureFeature requestFeature request