Nico
Nico

Reputation: 123

AWS Api Gateway Custom Domain Name with undefined stage

I'm trying to set up a Custom Domain Name in AWS API Gateway where callers have to specify explicitly the stage name after any base path name. It is something I did in the past but now it seems that, since AWS updated the console interface, it is no more possible. The final url should be like:

https://example.com/{basePath}/{stage}/function

What is funny (or frustrating) is that I have some custom domain names created with the old console and that are perfectly working, without any stage defined.

Upvotes: 0

Views: 2476

Answers (1)

Paradigm
Paradigm

Reputation: 2026

It is still possible to specify only the "API ID" and "Path" and leave out the "stage" parameter. I have tried this both from the console and the CLI:

  • From console: The "Stage" setting is a drop-down as you mentioned, but can be left blank (don't select anything). If you did select a stage, delete the API mapping and add it again

  • From CLI: Just tried this as well and works fine for me on CLI version aws-cli/1.18.69 Python/3.7.7 Darwin/18.7.0 botocore/1.16.19

$ aws apigateway create-base-path-mapping --domain-name **** --rest-api-id *** --base-path test
{
    "basePath": "test",
    "restApiId": "***"
}

Upvotes: 2

Related Questions