This message was deleted.
# general
s
This message was deleted.
b
I think a
CustomResource
would be a good fit here. There's a couple of examples here: https://github.com/pulumi/examples/search?q=CustomResource&unscoped_q=CustomResource That might get you started
f
Hi @billowy-army-68599, Thanks for point that out. Sorry for my late reply, we’re totally overflowed right now. I’ll give it a shot asap, but I’m surprised to not see any difference (at least in your example) between a
CustomResource
and a
ComponentResource
. I would have expected to have to define some
create
,
update
and
delete
methods to make Pulumi aware on how to manage my resource during up and detect changes ?
Ok, trying to understand from what you guys already done, like https://github.com/pulumi/pulumi-postgresql/blob/master/sdk/nodejs/extension.ts For example this one states ” The ``postgresql.Extension`` resource creates and manages an extension on a PostgreSQL” but I can’t see anywhere in the code where you are actually creating the extension in the database, all I see is something describing an extension that already exists, nothing to manage it in the database (create, update or delete). That’s the same in all
CustomResource
I’m looking in, so clearly I’m missing something here. Maybe it doesn’t work as I thought it would and does not fit my needs ? Could use some quick implementation advices, the pulumi way @echoing-match-29901 Ultimately I need to define a Resource able to run a bunch of REST calls inside the cluster during creation, some others if arguments changes and some if the resource gets deleted. Obviously I need to be able to detect when my custom resource (!=
CustomResource
?) changes its state (created, arguments changed, deleted). Thanks for your help 🙏
@faint-table-42725 sorry to bother, but since you’re around, I could definitely use your input on this one if you have a sec.
Ok, I needed a
ResourceProvider
to actually use a
CustomResource
. That was unclear and certainly not a daily usecase. For anyone wanting/needing to implement one, here’s the link: https://www.pulumi.com/docs/intro/concepts/programming-model/#dynamicproviders I’ll start from there, thanks.
f
Sorry — I missed that @mention somehow — glad to hear you figured out the path forward.
f
@faint-table-42725 no worries, we’re all busy and that’s not your priority anyway. So, just to be sure, that’s the way to do it, given what I want to achieve, right ? 😅
f
Yes, a dynamic provider sounds like the right approach given you need to run those REST calls at different points of the lifecycle — so you’re basically creating a resource that knows how to handle those actions.
f
Great, thanks for your feedback, at least I know I’m going in the right direction. Now I need to implement it right, seems not like a trivial thing to do, but I should be fine.