GoogleCloudPlatform / deploymentmanager-samples

Deployment Manager samples and templates.
Apache License 2.0
937 stars 718 forks source link

Cannot Create Cloud SQL With DatabaseVersion POSTGRES_12 Using Deployment Manager #582

Open tl-yang opened 3 years ago

tl-yang commented 3 years ago

According to documentation, POSTGRES_12 should be supported? But when I tried to use deployment manager to create Cloud SQL with DatabaseVersion POSTGRES_12, it failed with

Manifest expansion encountered the following errors: Invalid properties for 'cloud_sql.py':
    'POSTGRES_12' is not one of ['MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'POSTGRES_9_6', 'POSTGRES_11', 
'SQLSERVER_ENTERPRISE_2016', 'SQLSERVER_2017_STANDARD', 'SQLSERVER_2017_ENTERPRISE', 
'SQLSERVER_2017_EXPRESS', 'SQLSERVER_2017_WEB'] at ['databaseVersion']

The cloud_sql.py I'm using is the one from cloud-foundation-toolkit.

Is this a bug or did I miss something?

Thank you very much for your help!

KevinEmery commented 3 years ago

The error you're getting is because the cloud-sql.py template in cloud-foundation-toolkit has a matching schema file, that specifies the specific values that are supported by the template. That list was last updated in December 2019 as part of this commit, so any version that was added since wouldn't be in the existing list, which is what I expect is happening here.

Modifying the list of valid databaseVersions to add POSTGRES_12 should be sufficient to unblock you, whether that's modifying the local version you're using or putting up a pull request for the cloud-foundation-toolkit repository.