Hi guys, I'm going to import some existing resourc...
# general
r
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
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
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
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
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
https://github.com/pulumi/pulumi-hugo/issues/1265 <- so this doesn't get lost in slack churn
r
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
We will ensure we note this - thanks for the feedback - we definitely want to make this easier to find
🙌 1
r
thanks @echoing-dinner-19531 for creating the ticket. Is documentation open-sourced, also?
e
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