When creating a resources.json file for `pulumi im...
# general
When creating a resources.json file for
pulumi import
, how should we handle resources that do not actually exist, like providers and components? Context: I reimplemented a legacy TF code base with Pulumi. Now I want to write a script that generates a
import file based on the terraform state. According to https://www.pulumi.com/docs/guides/adopting/import/,
is mandatory, but when reading a Pulumi state file, components have no ID.
Where can I see an example of a
file that import resources with components as parents?
Update, for those who face the same kind of migration: passing
makes it much easier!
At the moment, it’s not possible to import resources that don’t actually exist in the underlying provider.
is essentially a way to tell Pulumi: “grab the underlying state of a resource from a cloud provider”. I think you’ll need to add components and providers after you run the import.
@ancient-policeman-24615 Passing
did the trick. I am now able to import all legacy resources into my Pulumi state, with components. 🙂