More Info:
Ensure spanner database is highly available in multiple locationsRisk Level
LowAddress
Reliability, SecurityCompliance Standards
HIPAA, HITRUST, SOC2, NISTCSF, PCIDSSTriage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of Spanner Database not being highly available on GCP, you can follow the below steps:
- Open the GCP Console and navigate to the Spanner instance that needs to be remediated.
- Click on the instance name to open the instance details.
- Under the “Instance Configuration” section, click on “Edit”.
- In the “Edit Instance Configuration” window, scroll down to the “High Availability” section.
- Select the “Regional” option to enable regional availability for the Spanner instance.
- Choose the desired region for the Spanner instance from the drop-down menu.
- Click on “Save” to apply the changes.
- Once the changes are saved, the Spanner instance will be highly available across the selected region.
Using CLI
Using CLI
To remediate the misconfiguration of Spanner Database not being highly available in GCP using GCP CLI, you can follow the below steps:
- Open the Cloud Shell in the GCP console.
-
Run the following command to check the current configuration of Spanner Database:
Replace
[INSTANCE_NAME]
with the name of the Spanner Database instance and[PROJECT_ID]
with the ID of the GCP project. -
Check the value of the
availabilityConfig
field in the output of the above command. If the value isREGIONAL
, then the instance is highly available. If the value isZONAL
, then the instance is not highly available. -
To make the instance highly available, run the following command:
Replace
[INSTANCE_NAME]
with the name of the Spanner Database instance and[PROJECT_ID]
with the ID of the GCP project. - After running the above command, the instance will be updated to be highly available. You can check the configuration again by running the command in step 2.
Using Python
Using Python
To remediate the misconfiguration of Spanner Database not being highly available in GCP, you can follow these steps using Python:By following these steps, you can remediate the misconfiguration of Spanner Database not being highly available in GCP using Python.
- Check the current configuration of the Spanner Database:
- If the database is not highly available, update the configuration to make it highly available:
- Verify that the database is now highly available by checking the database configuration: