Open sandervb2 opened 9 months ago
@Frassle Can you help me read this message? Why have we printed this diagnostics?
The first message is from codegen, that it can't assign an expression of one shape to a location of another (there's a "to location of type" hidden in the middle of that long message).
Now that's probably a Read bug, because I'd expect the shape of date returned from Read to match the schema shape. But it's probably an import/codegen bug as well because we should be tolerant to bad Read implementations. I think we could warn that the types don't match but we should still try and write out the best guess of the code.
The warnings after:
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: aws:wafv2/webAcl:WebAcl resource '<resource_name>' has a problem: expected rule.13.statement.0.and_statement.0.statement.0.or_statement.0.statement.4.sqli_match_statement.0.field_to_match.0.body.0.oversize_handling to be one of ["CONTINUE" "MATCH" "NO_MATCH"], got . Examine values at '<resource_name>.rules'.
...
Are that after we got the data from Read we passed it back to Check, and Check reported those failures. This is just a provider bug, either in Read or Check (or both).
It's difficult to read such a long type printout, but it could be that it's failing to match null against the expected type as in https://github.com/pulumi/pulumi-aws/issues/2534 - if the root-cause is the same, that'd be an error because in TF null may populate every type; even when bridged providers emit required signatures for output properties to emit SDKs that are not projecting as Optional to the runtime, these may and will be populated by null in certain situations.
The other ticket that may be relevant here is https://github.com/pulumi/pulumi-terraform-bridge/issues/1225 where we're not running validators in the same order as TF would.
It would be a great help if we had a quick repro here I could try some possible fixes on, much appreciated.
What happened?
Normally after successfully importing a resource i get the python code to add to my program but when I tried to import a aws.wafv2.WebAcl resource, I got the following error:
Example
I used the following command to import the WebAcl resource:
Output of
pulumi about
Additional context
I noticed that the import function in the api docs for the wafv2.WebAcl is not there (anymore?) After selecting yes at the prompt to confirm the WebAcl import, I received the following warnings:
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).