Plannable Import (Terraform 1.5) How does it actually work?

Hello,

We are doing some trails with the plannable imports for terraform 1.5 website: plannable import docs by kmoe · Pull Request #33266 · hashicorp/terraform · GitHub

Tried to look at the code but couldn’t really find the logic.

What happens if:

import {
  to = aws_instance.example
  id = "i-abcd1234"
}

resource "aws_instance" "example" {}

First time it will import the resource and add it to the state, all good. But what’s the logic for the import when running the same apply again? Will it look in the state and see IF resource “aws_instance” “example” has an id in the state? what happens if it’s a different ID than the one we want to import? Will it skip or overwrite?

So just after the logical flow. I think it would be nice to have in the documentation.
I could test it but will give this way a try first :slight_smile:

To report a specific gap in the documentation, I would suggest opening a GitHub issue, as forum topics do not have an open/closed status, so rapidly fade into obscurity as they age.

did that Improve suggested documentation around plannable "import" in terraform 1.5 with logical flow · Issue #33280 · hashicorp/terraform · GitHub