https://pulumi.com logo
Title
r

rough-oyster-77458

03/26/2022, 1:26 AM
Hi guys, I'm going to import some existing resources with
pulumi import [type] [name] [id]
command. How can I get
type
for my resources?
m

millions-journalist-34868

03/26/2022, 9:05 AM
If you look at the documentation of your provider, on each resource you can see an example of an import command that gives you the type of the resource.
👍 1
e

echoing-dinner-19531

03/26/2022, 11:11 PM
You can also check the SDK code. https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/s3/bucket.ts#L334 for example is the type for old aws providers s3 bucket resource.
👍 1
r

rough-oyster-77458

03/27/2022, 4:31 PM
Thanks, guys. It's not obvious from the first look. Especially, if you're a newbie to Pulumi. It'd would be great to add this to
pulumi import
doc (https://www.pulumi.com/docs/reference/cli/pulumi_import/)
b

broad-dog-22463

03/27/2022, 8:49 PM
Hey @rough-oyster-77458 - if we update the docs to say “look for the Import sections in the API Docs for the type” would that help - we can also link to an example
e

echoing-dinner-19531

03/27/2022, 8:50 PM
https://github.com/pulumi/pulumi-hugo/issues/1265 <- so this doesn't get lost in slack churn
r

rough-oyster-77458

03/27/2022, 8:59 PM
hi @broad-dog-22463 Yes, it would, I guess. Later on, I found that each API doc contains the import section, but every newcomer looks at "pulumi import" command documentation first.
👍 1
b

broad-dog-22463

03/27/2022, 9:00 PM
We will ensure we note this - thanks for the feedback - we definitely want to make this easier to find
🙌 1
r

rough-oyster-77458

03/27/2022, 9:00 PM
thanks @echoing-dinner-19531 for creating the ticket. Is documentation open-sourced, also?
e

echoing-dinner-19531

03/27/2022, 9:19 PM
Yes, although the CLI commands are auto-generated from the pulumi --help text. So the page https://www.pulumi.com/docs/reference/cli/pulumi_import/ is using the content from https://github.com/pulumi/pulumi/blob/master/pkg/cmd/pulumi/import.go#L306
👍 1