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

important-vegetable-39003

12/21/2021, 12:24 PM
Hi folks, new to Pulumi and enjoying it so far, but wanted to ask one thing. Say I try to create an existing resource (and ofc it fails). If the resource already exists, how can I register it to state?
e

elegant-window-55250

12/21/2021, 12:30 PM
You can either use the
import
argument or
pulumi import
. Let me find you some documentation 🙂
i

important-vegetable-39003

12/22/2021, 12:24 PM
Sorry for the late reply, stuff came up.
So as far as I understand the resource has to defined explicitly, there is no option to import resource when you get an existing resource error.
e

elegant-window-55250

12/22/2021, 7:28 PM
You do that with
pulumi import
.
With that command the resource is imported to your stack, and Pulumi gives you the code for that resource (which you typically just copy)
2 Views