cloudsql - postgres
See original GitHub issueI’ve been trying to extend the cloudsql mysql example to include POSTGRES options. So what is the deal? For me what fails is the failover section of code. I’ve tried (as you can see) to set the locationPreference
because I read that needs to be different from the original. I’ve also set the availabilityType: REGIONAL
for the master.
{% if properties['failover']['enabled'] %}
- name: {{ ID }}-failover
type: sqladmin.v1beta4.instance
properties:
backendType: SECOND_GEN
instanceType: READ_REPLICA_INSTANCE
databaseVersion: {{ properties['cloudsql']['databaseVersion'] }}
region: {{ properties['cloudsql']['region'] }}
masterInstanceName: $(ref.{{ ID }}-master.name)
replicaConfiguration:
failoverTarget: true
settings:
tier: {{ properties['cloudsql']['tier'] }}
locationPreference:
zone: {{ properties['failover']['zone'] }}
{% endif %}
Any idea what might be the problem? the error isn’t very descriptive.
{"ResourceType":"sqladmin.v1beta4.instance","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"Invalid instance property.","reason":"invalidInstanceProperty"}],"message":"Invalid instance property.","statusMessage":"Bad Request","requestPath":"https://www.googleapis.com/sql/v1beta4/projects/wrkerz-test-3/instances","httpMethod":"POST"}}

Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cloud SQL for PostgreSQL documentation - Google Cloud
Cloud SQL for PostgreSQL is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on ......
Read more >Setting Up Database Monitoring for Google Cloud SQL ...
Database Monitoring provides deep visibility into your Postgres databases by exposing query metrics, query samples, explain plans, database states, ...
Read more >Database Access with PostgreSQL on GCP Cloud SQL
Database Access with PostgreSQL on GCP Cloud SQL · Step 1/7. Enable Cloud SQL IAM authentication · Step 2/7. Create a service account...
Read more >Getting Started with Cloud SQL for PostgreSQL - YouTube
See how easy it is to get started with Google Cloud SQL for MySQL and PostgreSQL.
Read more >Connecting a Google CloudSQL PostgreSQL Destination to ...
In this tutorial, we'll walk you through how to connect a Google CloudSQL PostgreSQL instance to Stitch as a destination. For more info...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jonbcampos I just (frustratingly) ran into this same error, but think I found a solution.
From looking at the project audit logs I was trying to deploy to it looked like this was a
500
response from Google rather than what the error leads you to believe would be a400
. This led me to manually enableHigh availability
directly on the master in the console.Unlike what I have seen with MySQL CloudSQL failover replicas, the failover was reported in the console as
Enabled
rather than a separate instance listing. I was able to describe the master and notice that it was described with the following attributes:Upon removing the failover instance from the template and adding the above properties the deployment worked. E.g.
Ideally the example could be updated to work, but until then hopefully this helps.
Cool, thanks for the pointer @ocsig !