https://pulumi.com logo
i

icy-oil-74929

07/03/2023, 3:55 PM
I am having a hard time finding documentation on how to author providers. Currently have based off of https://github.com/pulumi/pulumi-go-provider Sadly this is for internal use, so unable to share much… But I need to instantiate an API client with credentials from configuration. I would prefer to do this only once, can I do that? I would like a config option for
environment
which should be an enum, how do I do that? And lastly, I am getting this weird error:
Copy code
panic: invalid Go source code:

amma/resources/init.go

: 35:18: expected operand, found '.' (and 1 more errors)
I cannot identify the cause 😕
a

ancient-policeman-24615

07/12/2023, 9:29 AM
Right now the best way to set something like that up would be with a Config object that overrides CustomCheck. I’ll try to merge https://github.com/pulumi/pulumi-go-provider/pull/97 soon, which adds direct support for a configure step that doesn’t relate to state. The credentials example uses a provider config. It should give you somewhere to start.