serverless-application-model: Pproperty ApiKeySourceType not defined for resource of type AWS::Serverless::Api
Description:
I wanted to specify the Api Key Source to AUTHORIZER
in the SAM template.yaml
file since I use custom Lambda authorizer but it didn’t succeed.
Steps to reproduce the issue:
- Create new SAM project and try to add a new resource that uses
AWS::Serverless::Api
similar to:
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
ApiKeySourceType: AUTHORIZER
StageName: Prod
- run
sam validate
Observed result:
When running sam validate
I got the error:
Error: [InvalidResourceException('MyApi', 'property ApiKeySourceType not defined for resource of type AWS::Serverless::Api')] ('MyApi', 'property ApiKeySourceType not defined for resource of type AWS::Serverless::Api')
Expected result:
- I expect
AWS::Serverless::Api
to accept this parameterApiKeySourceType
because it’s supported in theAWS::ApiGateway::RestApi
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-apikeysourcetype
Note: I tried to use AWS::ApiGateway::RestApi
to define my API in the SAM template but it didn’t work out.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 22
- Comments: 21 (5 by maintainers)
This was release in v1.46.
closing
Just hit this issue with a customer, it’d be great to have supported.
Customer use case: Mobile App can’t be updated for certain customers thus requiring API Keys to be dynamically assigned at the Authorizer level. This allows them to set rate limit and burst depending on their tenant group and without having the Mobile devices updated.
cc @praneetap