https://pulumi.com logo
#general
Title
# general
l

late-journalist-61387

09/26/2023, 8:04 AM
Hi, How can I run a command only one time after the resource has been created successfully? think I am setting up and RDS instance, now, I want to run some migration code after RDS became online for first time. I know that I can use apply, but this will run everytime ....
d

dry-keyboard-94795

09/26/2023, 8:14 AM
If it's an external command, you can use the Command provider: https://www.pulumi.com/registry/packages/command/
l

late-journalist-61387

09/26/2023, 8:18 AM
Thanks, but it seems that it only run cli commands, however I want to run typescript codes also
d

dry-keyboard-94795

09/26/2023, 8:33 AM
As far as I know, there isn't a way to do it safely. Maybe there's a database provider that does what you need, like postgres: https://www.pulumi.com/registry/packages/postgresql/
l

late-journalist-61387

09/26/2023, 8:34 AM
I see, but database was an example, for example I want to run the some browser test code with selenium
or puppeteer
d

dry-keyboard-94795

09/26/2023, 8:35 AM
Oh, there's dynamic providers. I always forget about them 😆 https://www.pulumi.com/docs/concepts/resources/dynamic-providers/ Has a bit of overhead, but a lot of flexibility. Might work for your needs
l

late-journalist-61387

09/26/2023, 8:36 AM
Perfect!!!! 🙌👋
s

stocky-restaurant-98004

09/26/2023, 11:47 PM
You can also use the command provider to run your external TypeScript program.