Hi, How can I run a command only one time after th...
# general
l
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
If it's an external command, you can use the Command provider: https://www.pulumi.com/registry/packages/command/
l
Thanks, but it seems that it only run cli commands, however I want to run typescript codes also
d
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
I see, but database was an example, for example I want to run the some browser test code with selenium
or puppeteer
d
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
Perfect!!!! 🙌👋
s
You can also use the command provider to run your external TypeScript program.