I’m struggling a bit with importing resources and ...
# general
b
I’m struggling a bit with importing resources and am not sure what’s the issue. I created AWS ECR using this code:
Copy code
apiECRRepo, err := ecr.NewRepository(ctx, "fooapp-api-pulumi", nil)
if err != nil {
	return err
}
ctx.Export("apiRepoUrl", apiECRRepo.RepositoryUrl)

uiECRRepo, err := ecr.NewRepository(ctx, "fooapp-ui-pulumi", nil)
if err != nil {
	return err
}
ctx.Export("uiRepoUrl", uiECRRepo.RepositoryUrl)
Now I’m trying out the import feature using this code:
Copy code
apiECRRepo, err := ecr.NewRepository(ctx, "fooapp-api-pulumi-b730658", nil, pulumi.Import(pulumi.ID("fooapp-api-pulumi-b730658")))
if err != nil {
	return err
}
ctx.Export("apiRepoUrl", apiECRRepo.RepositoryUrl)

uiECRRepo, err := ecr.NewRepository(ctx, "fooapp-ui-pulumi-b25077e", nil, pulumi.Import(pulumi.ID("fooapp-ui-pulumi-b25077e")))
if err != nil {
	return err
}
ctx.Export("uiRepoUrl", uiECRRepo.RepositoryUrl)
The repos were created with the name
fooapp-...
and then Pulumi added some lil hash/id whatever. I’m not sure if this belongs to the name/id now or not. The error I get:
Copy code
Diagnostics:
  aws:ecr:Repository (fooapp-api-pulumi-b730658):
    warning: inputs to import do not match the existing resource; importing this resource will fail

  aws:ecr:Repository (fooapp-ui-pulumi-b25077e):
    warning: inputs to import do not match the existing resource; importing this resource will fail
So my question is: What inputs do not match? I can also see by
[diff: ~name]; 1 warning
that it seems the name differs. But is there any way to show me the diff? Then I could get an idea on what’s the issue but nope. If I jun the command with
-j
to get JSON output I can see the diff but it says
"detailedDiff": null
Great 😅