pulumi / pulumi-terraform

A resource package that allows Pulumi programs to use Terraform state
Apache License 2.0
112 stars 18 forks source link

Expose Provider resource #710

Open folliehiyuki opened 1 year ago

folliehiyuki commented 1 year ago

Hello!

Issue details

People like myself often opt to disable the default providers completely (through pulumi:disable-default-providers: [*] config) and set them up within Pulumi programs.

Currently this provider sets up the provider resource here, which cannot be configured by the user and doesn't follow the standard pattern in other Pulumi providers:

NewProvider(ctx *pulumi.Context, name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) {}

https://github.com/pulumi/pulumi-terraform/blob/792ae89c10daeeaeea40a20dcfeabf970295aabb/provider/cmd/pulumi-resource-terraform/provider.go#L36

Affected area/feature

Adding Provider resource API.

AaronFriel commented 1 year ago

Hey @FollieHiyuki, thanks for flagging this, it looks like we need to update this provider to support our modern code generation for SDKs.

The file and constructor you found in pulumi-terraform/provider/cmd/... is part of the plugin binary that implements Pulumi's Provider RPC. Our SDKs are always published under a directory pulumi-*/sdk/....

An example of that from another provider:

https://github.com/pulumi/pulumi-cloudflare/blob/master/sdk/go/cloudflare/provider.go#L48-L49

AaronFriel commented 1 year ago

When we implement #702:

We'll also solve your issue, would you mind subscribing to that issue so that I might close this one as a duplicate?