https://pulumi.com logo
#google-cloud
Title
# google-cloud
m

most-magician-78411

05/04/2021, 3:51 AM
is there a way to work around import errors like when trying to import a postgress replica? any help would be much appreciated. thanks!
Copy code
gcp:sql:DatabaseInstance (beta-postgres-replica1):
    error: gcp:sql/databaseInstance:DatabaseInstance resource 'beta-postgres-replica1' has a problem: AtLeastOne: "clone": one of `clone,settings` must be specified. Examine values at 'DatabaseInstance.Clone'.
    error: gcp:sql/databaseInstance:DatabaseInstance resource 'beta-postgres-replica1' has a problem: AtLeastOne: "settings": one of `clone,settings` must be specified. Examine values at 'DatabaseInstance.Settings'.
    error: Preview failed: one or more inputs failed to validate
b

broad-helmet-79436

05/04/2021, 10:36 AM
I’ve set up a postgres replica with Pulumi very recently!
and yeah, you have to specify the settings for the replica 🙂
👍 1
I think you can also put
clone: 'the-name-of-the-master-instance'
but I didn’t end up doing that because I wanted control over region and disk type, so I just ended up duplicating most of the settings from the master instance into the replica instance
m

most-magician-78411

05/05/2021, 2:40 PM
Thanks! I’ll give it another go!
Actually I think my problem is I don’t know which settings to use to indicate that it’s a read replica and that replication would be set up for Postgres. For MySQL there seems to be configuration options but I didn’t see any for Postgres. Without it I think it’ll just create a separate instance of Postgres. I’m missing something.