-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulumi import of a linode resource results in warnings #373
Comments
It's plausible this is related to pulumi/pulumi-terraform-bridge#577. |
Toward #1225 - this fixes the special case of ConflictsWith warnings. This fixes spurious warnings on `pulumi import`, popular bugs such as: - pulumi/pulumi-aws#2318 - pulumi/pulumi-aws#3670 - pulumi/pulumi-gitlab#293 - pulumi/pulumi-gcp#844 - pulumi/pulumi-linode#373 TF does not guarantee Read results to be compatible with calling Check on, in particular Read can return results that run afoul of ConflictsWith constraint. This change compensates by arbitrarily dropping data from the Read result until it passes ConflictsWith checks. This affects `pulumi refresh` as well as I think it should although I have not seen "in the wild" cases where refresh is affected, since it typically will not copy these properties to the input bag unless they're present in old inputs, which are usually correct wrt to ConflictsWith.
Still having some issues here: package main
import (
"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
inst, err := linode.NewInstance(ctx, "web", &linode.InstanceArgs{
Label: pulumi.String("simple_instance"),
Image: pulumi.String("linode/ubuntu22.04"),
Region: pulumi.String("us-central"),
Type: pulumi.String("g6-standard-1"),
AuthorizedKeys: pulumi.StringArray{
pulumi.String("ssh-rsa AAAA...Gw== [email protected]"),
},
RootPass: pulumi.String("this-is-not-a-safe-password"),
Tags: pulumi.StringArray{
pulumi.String("foo"),
},
SwapSize: pulumi.Int(256),
PrivateIp: pulumi.Bool(true),
})
if err != nil {
return err
}
ctx.Export("instId", inst.ID())
return nil
})
} And:
About:
Although the bridge made progress on heuristics to automatically resolve ConflictsWith warnings during import, issues remain with imported values not passing validators and perhaps there is more work to be done. |
It looks like pulumi/pulumi-terraform-bridge#2277 approach may be relevant here but may not fully fix this given that the violations are nested properties. Generalizing that could work. |
The remaining issue could be mitigated by pulumi/pulumi-terraform-bridge#2314 if it handled recursive values. |
What happened?
I tried to import a resource using the Linode provider, which resulted in the following warnings:
It's pretty easy to fix, but I figured opening a bug report would be a good idea anyway.
Example
resulted in the following program:
The
SwapSize
here seems to conflict with the swap partition defined in theDisks
struct.Output of
pulumi about
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).
The text was updated successfully, but these errors were encountered: