I'm trying to figure out a dependency issue and fe...
# general
I'm trying to figure out a dependency issue and feel like I'm missing the right resource option to use. We're creating an RDS database with Pulumi and also configuring users/schemas/permissions. Since the latter all live inside the database, they need to be recreated if the db gets recreated, ie they are implicitly deleted on a db instance deletion.
forces the correct ordering but Pulumi doesn't know to recreate them.
would work except its only for properties on the same resource.
maybe you want
Are you working only with the RDS Instance resource, or other Pulumi Resources, e.g. https://www.pulumi.com/registry/packages/postgresql/api-docs/
https://www.pulumi.com/registry/packages/aws-native/api-docs/rds/dbinstance/ for the instance, and then yeah, that postgres package for configuring postgres itself. Provider that connects up to the ip grabbed from the dbinstance, and using
, etc. with that provider
Specifically what happens right now is that when there's a change to the DBInstance definition that forces the RDS instance to be recreated, that happens but Pulumi doesn't try to recreate the schemas because it doesn't know they got deleted
In that case, maybe you want to try delete before replace as well?
and is the parent / child relationship between the resources defined?
no, that I think is the thing that's missing
I have depends_on
but let me try that
ok, that maybe works, but I just broke something else that this all depends on 😅 so I need to go spend some time fixing that before I can fully test this. Let's hope it's working when I come back to it. Thanks for your help!
@brave-motorcycle-67487 There’s a property called ‘deletedWith’ that I think you are looking for. Though it does not appear to be covered in the documentation 🤔
I've confirmed that parent and depends_on do not fix this
deleted_with it appears did not work at all in the version of the python sdk I've been using 😬 https://github.com/pulumi/pulumi/commit/0b13f9169d6f3bb57195ae98bec04753abca1c62 so I'm upgrading and testing it
yeah, that doesn't work either - it still doesn't prompt recreation of the schemas