Inam Imthiyaz
Inam Imthiyaz

Reputation: 39

Google Cloud Spanner Static Instance ID

I have a question whether we can have a static cloud spanner instance id ? Say we destroy the spanner instance at the end of the day and get it running again in the morning, is there a way to make sure we can get the same spanner instance id ?

If this is not possible, is there a way we can use a DNS in front of spanner ? So when we recreate spanner the next time, we just have to modify the DNS to point to the new instance ?

Appreciate your thoughts ?

Upvotes: 0

Views: 354

Answers (1)

Knut Olav Løite
Knut Olav Løite

Reputation: 3512

Yes, that is perfectly possible, as you specify the instance ID yourself when you create a new Spanner instance. See https://cloud.google.com/spanner/docs/samples/spanner-create-instance for code samples in the different supported programming languages for examples on how to create a new instance in code.

Note however that deleting an instance is not something that you can 'undo' by re-creating a new instance the following morning with the same ID. Although the instances have the same ID, they are not the same, and all data from the previous day will have been lost.

Upvotes: 3

Related Questions