pulumi / pulumi-terraform-bridge

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

Ensure that name conflicts are a compile-time error #773

Closed t0yv0 closed 1 year ago

t0yv0 commented 1 year ago

What happened?

We encountered an issue with MakeTerraformInputs was non-deterministically clobbering the same slot in result due to naming/pluralization issues and the the fact that Go randomizes map traversal order. Specifically, these two pulumi.ResourcePropertyKey values:

"certificateAuthorities"
"certificateAuthority"

got mapped to the same Terraform attribute "certificate_authority".

This is based on pulumi-aws v5.28.0.

Expected Behavior

The expected behavior is to detect possible attribute slot conflicts at the time of compile-time analysis and schema generation (make tfgen) and report them as critical errors so that provider maintainers can correct them before releasing.

Steps to reproduce

TBD

Output of pulumi about

N/A

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

t0yv0 commented 1 year ago

This is addressed for top-level resource, data source and config properties in:

https://github.com/pulumi/pulumi-terraform-bridge/pull/775

There is some remainder work to make it check names of nested object types as well.