AWS::Serverless::HttpApi does not support Name attribute
AWS::Serverless::HttpApi transforms into AWS::ApiGatewayV2::Api but it is not possible to specify the Name attribute for the resulting API resource.
InvalidResourceException('HelloWorldApi', 'property Name not defined for resource of type AWS::Serverless::HttpApi')]
SAM CLI, version 0.52.0
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-httpapi.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html
FWIW it doesn't support FailOnWarnings or CorsConfiguration either 😕
@rowanu It supports both of those.
Sorry, my mistake: I was seeing the same error same error message in SAM CLI when trying to run ApiGatewayV2 locally, so will move to that repo.
AWS::Serverless::HttpApi Name will refer to stack_name. I created multiple HttpApi but the name shown in the console is the same name which is stack_name. So far I using Description attribute to differentiate the list of HttpApi.
MainApiGateway:
Type: AWS::Serverless::HttpApi
Properties:
# Name: !Sub ${ResourceEnv}-${ResourceProject}-MainApiGateway
Description: !Sub ${ResourceEnv}-${ResourceProject}-MainApiGateway
StageName: !Ref ResourceEnv
Hope got an update from the contributor that attribute Name can use in AWS::Serverless::HttpApi 😁
Other serverless resources that have Name (or their variant) property:
- AWS::Serverless::Api
- AWS::Serverless::Function
- AWS::Serverless::LayerVersion
- AWS::Serverless::SimpleTable
- AWS::Serverless::StateMachine
For consistency purpose, we should have it for "AWS::Serverless::HttpApi"
Hey @mndeveci or @jfuss what would it take to add this? I see it's already supported in AWS::ApiGatewayV2::Api.
Outside of this repo, is there any other changes that would need to be made? I don't mind making a PR to support this
Any update on this?
pending doc update to https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-httpapi.html