Open tgummerer opened 1 year ago
It's plausible this is related to https://github.com/pulumi/pulumi-terraform-bridge/issues/577.
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== user@example.local"),
},
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:
anton@anton-mbp-m3> pulumi import linode:index/instance:Instance mylinode $(pulumi stack output instId) ~/bugs/pulumi-linode-373
Previewing import (dev)
View in Browser (Ctrl+O): https://app.pulumi.com/anton-pulumi-corp/pulumi-linode-373/dev/previews/68e7c523-6f19-45e1-85c7-2a43e8f8dae8
Type Name Plan Info
pulumi:pulumi:Stack pulumi-linode-373-dev
= └─ linode:index:Instance mylinode import 8 warnings
Diagnostics:
linode:index:Instance (mylinode):
warning: urn:pulumi:dev::pulumi-linode-373::linode:index/instance:Instance::mylinode verification warning: The embedded config is deprecated and scheduled to be removed in the next major version.Please consider migrating it to linode_instance_config resource.
warning: urn:pulumi:dev::pulumi-linode-373::linode:index/instance:Instance::mylinode verification warning: The embedded disk block in linode_instance resource is deprecated and scheduled to be removed in the next major version. Please consider migrating it to be the linode_instance_disk resource.
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `linode` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: linode:index/instance:Instance resource 'mylinode' has a problem: Value for unconfigurable attribute. Can't configure a value for "config.0.id": its value will be decided automatically based on the result of applying this configuration.. Examine values at 'mylinode.configs[0].id'.
warning: linode:index/instance:Instance resource 'mylinode' has a problem: Value for unconfigurable attribute. Can't configure a value for "disk.0.id": its value will be decided automatically based on the result of applying this configuration.. Examine values at 'mylinode.disks[0].id'.
warning: linode:index/instance:Instance resource 'mylinode' has a problem: expected length of disk.0.root_pass to be in the range (11 - 128), got . Examine values at 'mylinode.disks[0].rootPass'.
warning: linode:index/instance:Instance resource 'mylinode' has a problem: expected length of disk.1.root_pass to be in the range (11 - 128), got . Examine values at 'mylinode.disks[1].rootPass'.
warning: linode:index/instance:Instance resource 'mylinode' has a problem: Value for unconfigurable attribute. Can't configure a value for "disk.1.id": its value will be decided automatically based on the result of applying this configuration.. Examine values at 'mylinode.disks[1].id'.
Resources:
= 1 to import
2 unchanged
Do you want to perform this import? [Use arrows to move, type to filter]
yes
no
> details
About:
CLI
Version 3.117.0
Go Version go1.22.3
Go Compiler gc
Plugins
KIND NAME VERSION
language go unknown
resource linode 4.21.0
Host
OS darwin
Version 14.5
Arch arm64
This project is written in go: executable='/Users/anton/bin/go' version='go version go1.22.2 darwin/arm64'
Current Stack: anton-pulumi-corp/pulumi-linode-373/dev
TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::pulumi-linode-373::pulumi:pulumi:Stack::pulumi-linode-373-dev
pulumi:providers:linode urn:pulumi:dev::pulumi-linode-373::pulumi:providers:linode::default_4_21_0
linode:index/instance:Instance urn:pulumi:dev::pulumi-linode-373::linode:index/instance:Instance::web
Found no pending operations associated with dev
Backend
Name pulumi.com
URL https://app.pulumi.com/anton-pulumi-corp
User anton-pulumi-corp
Organizations anton-pulumi-corp, moolumi, pulumi
Token type personal
Dependencies:
NAME VERSION
github.com/pulumi/pulumi-linode/sdk/v4 v4.21.0
github.com/pulumi/pulumi/sdk/v3 v3.118.0
Pulumi locates its logs in /var/folders/gd/3ncjb1lj5ljgk8xl5ssn_gvc0000gn/T/com.apple.shortcuts.mac-helper// by default
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 https://github.com/pulumi/pulumi-terraform-bridge/pull/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 https://github.com/pulumi/pulumi-terraform-bridge/issues/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).