0

Below command as per the documentation needs to map the custom domain to cloudrun service even if mapped to a different service. But currently, it is returning an error

gcloud beta run domain-mappings create --force-override  --service=ms-stutzen  --domain=stutzen.co  --region 'us-central1'
ERROR: (gcloud.beta.run.domain-mappings.create) Domain mapping to [stutzen.co] already exists in this region.

Is there any other command to perform deletion and remapping in a single command?

arvindwill
  • 1,960
  • 1
  • 23
  • 39

1 Answers1

0

You can able to delete the existing domain mapping by the following command as mentioned in the documentation for deletion:

Syntax:

gcloud beta run domain-mappings delete --domain=<your_domain>

Then you can create it again after deletion, there will be no conflicting.

You can refer to the documentation as mentioned here you may use 'DomainOverrideStrategy.OVERRIDE' to force overwrite the existing domain mapping.

You can refer to the stackoverflow answer where the whole description of adding this flag has been explained.

Divyani Yadav
  • 1,030
  • 4
  • 9
  • Is it possible to add this flag from Console while creating? – arvindwill Oct 12 '21 at 03:43
  • 1
    @arvindwill I have updated my answer by adding a stackoverflow answer thread , Hope it helps. – Divyani Yadav Nov 17 '21 at 06:32
  • Using Managed platform. Is there any reason why DomainOverrideStrategy.OVERRIDE are not mentioned in this document. https://cloud.google.com/sdk/gcloud/reference/beta/run/domain-mappings/create – arvindwill Nov 26 '21 at 14:19