https://pulumi.com logo
#general
Title
# general
b

bulky-agent-73210

05/03/2022, 12:51 PM
Hey folks, is it possible to
pulumi import
a resource from custom provider?
e

echoing-dinner-19531

05/03/2022, 12:53 PM
As long as the provider implements the Read method yes
b

bulky-agent-73210

05/03/2022, 1:00 PM
Great, thanks. In this definition, what is contained in the input map argument:
Read func(context.Context, map[string]interface{}) (map[string]interface{}, bool, error)
Is there a way for me to pass some args/data when running
pulumi import yyy
to the Read function?
e

echoing-dinner-19531

05/03/2022, 1:02 PM
if your importing the input map argument will be empty. Read is also used for refresh in which case the map will contain the inputs the engine currently knows about. The only information import will pass to Read is ID. Some providers encode properties as part of the ID as a way to pass information.
7 Views