https://pulumi.com logo
Title
g

gorgeous-painting-25877

08/25/2022, 2:22 PM
I want to program my own package in Typescript. Is this possible at all and if so are there any examples? So far I have come across https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers, is that what I am looking for? All existing packages in the registry seem to have been implemented directly in go or with the tf bridge.
l

limited-rainbow-51650

08/25/2022, 2:36 PM
Hey @gorgeous-painting-25877, if you want to create an NPM package with your abstractions, dynamic providers is not what you need to look at. Have a look at component resources: https://www.pulumi.com/docs/intro/concepts/resources/components/ These are regular JS/TS classes. After you built your components, follow the regular NPM package creation and publishing documentation. Nothing more to it.
g

gorgeous-painting-25877

08/25/2022, 2:38 PM
My goal is not to simplify or link existing elements, but to create new elements. I want to program a pulumi discord package with which you can define the discord as code
l

limited-rainbow-51650

08/25/2022, 2:39 PM
Ah, a Pulumi provider for Discord.
g

gorgeous-painting-25877

08/25/2022, 2:39 PM
In terraform it would be a provider, here I was not sure if it is called provider as well
l

limited-rainbow-51650

08/25/2022, 2:41 PM
General terminology is a package, but we have three different kinds: • native provider package • terraform bridged provider package • component package You can read more on that here: https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-language-components/
g

gorgeous-painting-25877

08/25/2022, 2:42 PM
So I can use existing providers in component packages but not create my own provider in e.g. typescript?
l

limited-rainbow-51650

08/25/2022, 2:43 PM
In your case, the fastest way is to take an existing Terraform Discord provider and bridge it to become a Pulumi provider package. There is not much manual work to that besides setting up a mapping from Terraform resource names to Pulumi resource names, complemented with a build setup.
At the moment, we do not have everything ready yet to have a pure Typescript Pulumi provider package. We only have this in Go for now.
g

gorgeous-painting-25877

08/25/2022, 2:45 PM
Unfortunately, there is no sufficiently well supported discord terraform module. So I would have to teach myself Go to implement the whole thing. Is there a roadmap for provider in typescript?
l

limited-rainbow-51650

08/25/2022, 2:51 PM
Not that I know off.
g

gorgeous-painting-25877

08/25/2022, 2:51 PM
Okay thanks for the help