Open rockey5520 opened 3 years ago
Hey @rockey5520,
SAM always creates a AWS::ApiGatewayV2::DomainName
resource if DomainName
is specified.
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-generated-resources-httpapi.html
To use existing custom domain, you can remove DomainName
and use AWS::ApiGatewayV2::ApiMapping
resource instead.
Closing. Let me know if there are other issues.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hey, @CoshUS I suppose your suggestion works and fits nicely for hello-world type applications. but this is not the ideal way of building mapping API to an existing domain which is already having several mappings from other API's
This approach only makes things complex by removing touching the components(API mapping, in turn downtime) during deployment. can we get this issue to be converted as a feature for sam cli?
@rockey5520 Sounds good. I'll transfer this to SAM repo and the feature request would be:
Add support for using existing custom domains for AWS::Serverless::HttpApi
and AWS::Serverless::Api
@CoshUS Thank you
Tangentially related request in https://github.com/aws/serverless-application-model/issues/2778#issuecomment-1382368707
Description:
I am trying to create a httpapi and map to an exisitng custom domain
Steps to reproduce:
Sample template.yml file
Observed result:
Expected result:
Map created httpapi to the custom domain and under paths given as per the template section BasePath
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.16.0Add --debug flag to command you are running