Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

gcloud cloud run - set a custom domains Integration with multi domain

I want set a integration as kind of Custom Domains - Google Cloud Load Balancing with several domain.

I have a problem with the syntax of the command.

In load balancer, SSL certificate can be built to support multiple domains. So, How to create a integration with several domain mapping?

sample command:

 

 

 

gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='set-mapping=domain1.com:serviceName'

 

 

 

 In this image, you can see that it is possible to define with several domains:
Screenshot 2023-01-22 at 16-56-43 Integratio…isio-core – Cloud Run – Tisio – Google Cloud console.jpg

The GCP document links:

  1. gcloud beta run integrations create
  2. Map custom domains using a global external HTTP(S) load balancer
0 2 1,131
2 REPLIES 2

Hi @bahador1988,

Welcome to Google Cloud Community!

To create a custom domains integration with multiple domain mappings using the gcloud command, you can use the --parameters flag and pass in a string of comma-separated key-value pairs, where the key is the domain name and the value is the service name.

For example, if you want to map domain1.com and domain2.com to serviceName, the command would look like this:
gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='set-mapping=domain1.com:serviceName,domain2.com:serviceName'​

You can also use the update command to add more mappings to an existing integration:
gcloud beta run integrations update --type=custom-domains --region=us-central1 --parameters='add-mapping=domain3.com:serviceName'​
You can check your integration setting by using this command
gcloud run services describe serviceName --platform=managed --region=us-central1​
Please keep in mind that you need to have SSL certificate for each domain you want to map to your service
 
Here are some additional links to the official Google Cloud documentation that provide more information on custom domains integration with Cloud Run:

These resources provide more detailed information on how to set up custom domains integration with Cloud Run, including how to map custom domain to a Cloud Run service, updating custom domain mapping, how to verify domain ownership, managing and renewing SSL certificates and troubleshoot custom domain.

Thank you

hi @christianpaula 

Thanks for your reply.
I tried the command you posted with real values (domain and service name).

gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='set-mapping=domain1.com:serviceName,domain2.com:serviceName'​

But I get the following error:

ERROR: (gcloud.beta.run.integrations.create) argument --parameters: Bad syntax for dict arg: [domain2.com:serverName]. Please see `gcloud topic flags-file` or `gcloud topic escaping` for information on providing list or dictionary flag values with special characters.
Usage: gcloud beta run integrations create --type=TYPE [optional flags]
  optional flags may be  --help | --name | --parameters | --region | --service

For detailed information on this command and its flags, run:
  gcloud beta run integrations create --help

I emphasize again that I used the real domain name and service name.