pulumi / pulumi-terraform-bridge

A library allowing Terraform providers to be bridged into Pulumi.
Apache License 2.0
200 stars 43 forks source link

Introduce an import heuristic to drop entries that fail validators #2314

Open t0yv0 opened 3 months ago

t0yv0 commented 3 months ago

Hello!

Issue details

Import for bridged providers may return data from Read() that does not pass validations. This causes Pulumi to report warnings.

Since the issue does not manifest as badly in TF as in Pulumi, the underlying Read() implementations are unlikely to be fixed upstream at scale. The suggestion therefore is to introduce heuristic-like code in the bridge that tries to autocorrect Read() results and drop entries that fail to pass validators. A similar tactic was applied in https://github.com/pulumi/pulumi-terraform-bridge/pull/1948

Initial implementation in https://github.com/pulumi/pulumi-terraform-bridge/pull/2337

Todo:

Affected area/feature

Affects import. See also:

t0yv0 commented 2 months ago

@corymhall I think https://github.com/pulumi/pulumi-terraform-bridge/pull/2337 has this mostly done but didn't tackle nested properties, that sounds right? Leaving it in the backlog for now until we have more evidence like linode 373 that this needs fixing.

corymhall commented 2 months ago

Yep that is correct.