pulumi / pulumi-terraform-bridge

A library allowing providers built with the Terraform Plugin SDK to be bridged into Pulumi.
Apache License 2.0
183 stars 41 forks source link

Unexpected type at field "tags.__defaults": expected string type, got [] type #2096

Open t0yv0 opened 1 week ago

t0yv0 commented 1 week ago

What happened?

Getting typechecker warning on a special Pulumi property __defaults:

Unexpected type at field "tags.__defaults":  expected string type, got [] type

Statefile like this:

            {
                "urn": "urn:pulumi:dev::pulumi-converter-terraform-78::aws:ec2/subnet:Subnet::b-2",
                "custom": true,
                "id": "subnet-08b3d7f060b43cae2",
                "type": "aws:ec2/subnet:Subnet",
                "inputs": {
                    "__defaults": [],
                    "availabilityZone": "us-west-2c",
                    "cidrBlock": "10.0.80.0/20",
                    "privateDnsHostnameTypeOnLaunch": "ip-name",
                    "tags": {
                        "Name": "subnet-b-2",
                        "__defaults": []
                    },
                    "tagsAll": {
                        "Name": "subnet-b-2",
                        "__defaults": []
                    },
                    "vpcId": "vpc-0fa364b07d4f41639"
                },
...

The __defaults is a special bridge property and should probably not participate in the type-checking pass at all.

Example

The repro is given in https://github.com/pulumi/pulumi-converter-terraform/issues/78

Output of pulumi about

See https://github.com/pulumi/pulumi-converter-terraform/issues/78

Additional context

N/A

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).

iwahbe commented 1 week ago

Thanks for opening an issue here @t0yv0. It looks like we need to tell the typechecker that we should ignore __* fields.