1

I have created an AWS Api Gateway (edge optimized) with CloudFormation. So far, everything works great. Now I´d like to make that API available under a custom domain, so I also added a custom domain resource to my CFN scripts. However, I do not see any possibility to also create an API mapping with CFN. If I create that manually, everything works fine, but I want do have it as part of the CFN scripts. I´ve seen in the documentation, that there is an ApiMapping available for Api Gateway v2 resources, but as per my understanding this does not work with edge optimized APIs. Can you help me here?

Kind regards

2
  • What is your CFN template and where is the issue with it? Commented Sep 24, 2021 at 7:20
  • 1
    You need a BasePathMapping resource to map a custom domain to a "v1" REST api. Commented Sep 24, 2021 at 8:41

1 Answer 1

2

The BasePathMapping indeed did the trick. That was not that obvious in my opinion, since the documentation nowhere states the purpose of that resource. Thank you.

Sign up to request clarification or add additional context in comments.

1 Comment

May be worth noting that API Gateway V1 doesn't support the slash character (/) in base path mappings. To create a multi-level base path mapping (e.g. v0/users), we need to use API Gateway V2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.