This message was deleted.
s
This message was deleted.
l
You tried not specifiying ids where? In which json? When you import the resources, all their normal outputs become available in Pulumi. This includes the id. You can use
endpoint.id
in the normal way.
e
I tried not specifying ids in the
resource.json
file that I fed into
pulumi import -f resource.json
E.g:
Copy code
{
  "resources": [
    {
      "type": "aws:sagemaker/endpoint:Endpoint",
      "name": "fake-model"
    },
    {
      "type": "aws:sagemaker/endpointConfiguration:EndpointConfiguration",
      "name": "fake-model"
    },
    {
      "type": "aws:sagemaker/model:Model",
      "name": "fake-model"
    }
  ]
}
Running that caused the tool to panic:
panic: fatal: An assertion has failed
I also tried using ARNs of those resources as
id
values. The tool didn’t panic but said it couldn’t find those resources.
l
ARNs and IDs are different.
e
Yea, thanks for clarifying! Do you know what ids should I use?
l
Ah, I see, you're using
pulumi import
. In this case, the name field is the name you want to use in Pulumi: it becomes the first parameter to the constructor of the resource. It is not necessarily the same as the name tag or field.
The id field is whatever you use to import the resource, as described near the bottom of each resource's page in the documentation. For endpoints, that's simply the endpoint name.
So the ID isn't the AWS ID or the Pulumi ID, it's the Terraform resource import ID. Pretty confusing...
e
Aha, I get it now! I updated the json file to use the AWS names for those resources as ids, and it stops panicking now. Thank you so much!
👍 2