busy-lawyer-33856
03/13/2023, 6:39 AMdb_instance = gcp.sql.DatabaseInstance.get("databaseinstance-resource",
id="ID"
)
dbs = gcp.sql.get_databases(instance=db_instance.id)
However, I get an attribute error:
AttributeError: module 'pulumi_gcp.sql' has no attribute 'get_databases'
I got the method from the documentation: https://www.pulumi.com/registry/packages/gcp/api-docs/sql/getdatabases/
I will greatly appraciate some help!
Best Regards
Eliasrhythmic-branch-12845
03/13/2023, 9:01 AMbusy-lawyer-33856
03/13/2023, 9:02 AMechoing-dinner-19531
03/13/2023, 9:59 AMbusy-lawyer-33856
03/13/2023, 12:48 PMpulumi up
after I have uninstalled the old version and installed 6.51.0, it just reinstall the 6.49 version again. As if it ignores the 6.51 version. Do you know what goes wrong?echoing-dinner-19531
03/13/2023, 3:29 PMup
should be installing any python bits? You need to use pip to uninstall and install the wanted version.busy-lawyer-33856
03/14/2023, 6:21 AM@pop-os:~/$ pulumi up
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Previewing update (starlab-stack):
Downloading plugin gcp v6.49.0: 47.01 MiB / 47.01 MiB [=============] 100.00% 2s
Type Name Plan Info
pulumi:pulumi:Stack starlab-starlab-stack 1 error
echoing-dinner-19531
03/14/2023, 11:38 AMbusy-lawyer-33856
03/14/2023, 2:56 PMup
it ignores it and install 6.49 as shown above.echoing-dinner-19531
03/14/2023, 4:09 PMbusy-lawyer-33856
03/14/2023, 4:10 PMechoing-dinner-19531
03/14/2023, 4:11 PMbusy-lawyer-33856
03/14/2023, 4:15 PMpulumi plugin install resource gcp
, i still have the problemechoing-dinner-19531
03/14/2023, 4:17 PMAttributeError: module 'pulumi_gcp.sql' has no attribute 'get_databases'
is nothing to do with the plugin, that's still just plain python.
I think that's just because get_databases is only in the 6.51 pip package https://github.com/pulumi/pulumi-gcp/blob/v6.51.0/sdk/python/pulumi_gcp/sql/get_databases.py#L75rhythmic-branch-12845
03/15/2023, 3:50 AMechoing-dinner-19531
03/15/2023, 9:08 AMare you saying that the state also records down the version of the packages that are/were used?Yes, because if you run a destroy we need to know what provider to use. We're looking at changing the behaviour here for up to try and skip the state provider as long as the program sends a provider to use instead but it's a tricky fix.
How do we view/edit/change these version numbers? (edited)stack export and stack import would let you edit this, but in general it should be necessary. Again the error in your first post is nothing to do with plugin versions. Update to the latest pip package and you shouldn't get a "no attribute" error, then just let the engine run as normal it will want both provider versions but will only use the latest one.
busy-lawyer-33856
03/15/2023, 9:42 AM