We need to provision a specific version of mysql (...
# general
s
We need to provision a specific version of mysql (8.0.26) with the gcp provider. I was looking at something like:
Copy code
instance = gcp.sql.DatabaseInstance("instance",
    database_version="MYSQL_8_0",
    name=f'us-gcp-csql-prod-{instance_num}-v8',
    project=f'{project}',
    region=f'{region}',
    settings=gcp.sql.DatabaseInstanceSettingsArgs(
        version=8026
    )
Per the docs, version is an
int
format of versioning isn't specified here https://www.pulumi.com/registry/packages/gcp/api-docs/sql/databaseinstance/#databaseinstancesettings But I get:
gcp:sql/databaseInstance:DatabaseInstance resource 'instance' has a problem: Value for unconfigurable attribute. Can't configure a value for "settings.0.version": its value will be decided automatically based on the result of applying this configuration.
Why can't we set the version? It's possible through the GCP console, is there another way?
d
I took a look at the REST API docs, and I think
settings.version
may relate to something else. It looks like you can specify the minor version for mysql through the
database_version
string from these values: https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion
so in your case, you'd use
database_version="MYSQL_8_0_26"
s
Ah, good point thanks @dry-keyboard-94795 I wasn't sure if I could be explicit in database_version as https://www.pulumi.com/registry/packages/gcp/api-docs/sql/databaseinstance/#state_database_version_python supported values only include generic major releases. I appreciate your input. I'll ping back here when I get a chance to test and verify with a specific version.