Closed erolabzait closed 12 months ago
Hello again,
I was able to fix it. I was defining an api gateway with resource 'StoreApiGateway'.
Resources:
StoreApiGateway:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: '${self:service}-${sls:stage}'
ProtocolType: HTTP
CorsConfiguration:
It seems that the plugin is searching for one of this 3 values HttpApi
| ApiGatewayRestApi
| WebsocketsApi
in the cloudformation output. You can find more details here https://github.com/amplify-education/serverless-domain-manager/issues/222
// Cloud Formation Resource Ids
public static CFResourceIds = {
[Globals.apiTypes.http]: "HttpApi",
[Globals.apiTypes.rest]: "ApiGatewayRestApi",
[Globals.apiTypes.websocket]: "WebsocketsApi",
};
So i had to rename StoreApiGateway
→ HttpApi
, this means it will create a new api (with a new api id) when you deploy 💔
Resources:
HttpApi:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: '${self:service}-${sls:stage}'
ProtocolType: HTTP
CorsConfiguration:
It will be nice to have an option to set a different name then HttpApi
.
Something like:
custom:
customDomain:
domainName: serverless.foo.com
stage: ci
...
customCFIdentifier: 'StoreApiGateway'
Thanks for this awesome plugin, 👍
Bug Report
Hello,
I am currently encountering an issue when attempting to deploy an API service that exports an api gateway for other services to use. Something similar to: https://github.com/GorillaStack/splitstack-postsapi but for the HTTP Api (V2)
Command Run I use the latest version of the plugin.
sls deploy
Console Output
Best regards,