Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I was in the process of adding a custom domain to a newly deployed project in Google App Engine when I came across this error - "domain is already mapped to a project." This was baffling as I've never had this domain mapped to any project and no-one else would have been able to map it either since that requires domain verification.

In my case the domain was atarigamer.com and this was the error I was seeing...
gae_dommap_1.png


The error appeared after completing the domain verification steps.

There was no way to resolve this via the web interface so I turned to the gcloud tool. There was a beta feature in the tool that allowed for domain mapping configuration. The gcloud tool is part of the Google Cloud SDK which can be downloaded here.

To add a custom domain to your project simply run something like this...
 Command
gcloud --project=<your_project_id> beta app domain-mappings create <domain>


Replace <your_project_id> with the ID of your project as found in the Google Cloud App Engine Console. Replace <domain> with the domain name you want to map to your project.



In my case the output was something like this...
 Output
Created [atarigamer.com].
Please add the following entries to your domain registrar. DNS changes can require up to 24 hours to take effect.
id: atarigamer.com
resourceRecords:
- rrdata: 216.239.32.21
- rrdata: 216.239.34.21
- rrdata: 216.239.36.21
- rrdata: 216.239.38.21
- rrdata: 2001:4860:4802:32::15
type: AAAA
- rrdata: 2001:4860:4802:34::15
type: AAAA
- rrdata: 2001:4860:4802:36::15
type: AAAA
- rrdata: 2001:4860:4802:38::15
type: AAAA


The output is not the best but if you've mapped a custom domain to an App Engine project it's easy to follow. The first four IPs are the 'A' records for the domain. The IPv6 IPs are the 'AAAA' records for the domain. All of these need to be put into your registra's DNS.

When I went back to the Google Cloud App Engine Console I could see that the mapping was successfully created and was pending SSL certificate activation.
gae_dommap_2.png


The only thing that this didn't do was create the 'CNAME' record for the 'www' subdomain. I wasn't too worried about that as I wasn't planning to use it anyway.

-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.