# Custom Domains in serverless APIs

**URL:** <https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464>\
**Category:** Chapter Comments\
**Created:** [August 26, 2021, 1:17am UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464 "2021-08-26T01:17:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [August 26, 2021, 1:17am UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/1 "2021-08-26T01:17:36Z")

</div>

Link to chapter — [https://serverless-stack.com/chapters/custom-domains-in-serverless-apis.html](https://serverless-stack.com/chapters/custom-domains-in-serverless-apis.html)

---

<div class="post-metadata">

**Author:** ![fatema](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/fatema/32/1379_2.png) [@fatema](https://discourse.sst.dev/u/fatema)\
**Post date:** [September 15, 2022, 9:08pm UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/2 "2022-09-15T21:08:24Z")

</div>

![Screenshot (168)](https://canada1.discourse-cdn.com/flex032/uploads/serverless_stack/original/2X/5/5c4a6dfe934b777c9dbdb81d16477d007ba68d24.png)

i have skipped the domain purchase chapter  
I replaced it with the domain shown to me  
As shown in the picture  
How can I activate it without buying a domain?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [September 15, 2022, 9:38pm UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/3 "2022-09-15T21:38:57Z")

</div>

You can just remove the domain code from there.

---

<div class="post-metadata">

**Author:** ![fatema](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/fatema/32/1379_2.png) [@fatema](https://discourse.sst.dev/u/fatema)\
**Post date:** [September 15, 2022, 9:51pm UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/4 "2022-09-15T21:51:36Z")

</div>

I don’t understand can you explain, thanks in advance

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/serverless_stack/original/2X/3/3207c42c375d5fa58283e60fc05f940fececf839.png)

If you mean it like this  
This also did not work

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [September 15, 2022, 10:13pm UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/5 "2022-09-15T22:13:07Z")

</div>

What’s the error you are getting now?

Btw, join our Discord, it’s easier to help you through the chat: [SST](https://discord.gg/sst)

---

<div class="post-metadata">

**Author:** ![wbrett30](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/wbrett30/32/1421_2.png) [@wbrett30](https://discourse.sst.dev/u/wbrett30)\
**Post date:** [March 7, 2023, 2:42am UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/6 "2023-03-07T02:42:10Z")

</div>

I’m getting this error when running the npx sst deploy --stage prod command:

prod-notes-ApiStack failed: The following context variables are not supported: [$context.identity.cognitoIdentityId] (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 5aef6cdd-a10e-4abc-bd0c-08040632e4e6; Proxy: null)

Then it rolls back all resource creation.  
Thanks for any help

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [March 9, 2023, 10:18pm UTC](https://discourse.sst.dev/t/custom-domains-in-serverless-apis/2464/7 "2023-03-09T22:18:21Z")

</div>

It was an AWS issue, we rolled out a fix for this. Try the latest SST version.
