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

fierce-bird-8909

09/28/2023, 1:52 PM
Hi, I have a small problem i have an imported resource and have set up a new pulumi project exported the resource settings and put it into the code. But pulumi still tries to delete the imported resource even if the attributes that cannot be changed are the same.
d

dry-keyboard-94795

09/28/2023, 2:40 PM
what's showing in the preview? A delete + a create? The output will help diagnosing
f

fierce-bird-8909

09/28/2023, 2:49 PM
yes delete and create
i would not give the output because it contains data i dont want to show in a public environment
d

dry-keyboard-94795

09/28/2023, 2:50 PM
are the resource names the same in the output?
f

fierce-bird-8909

09/28/2023, 2:50 PM
yes
d

dry-keyboard-94795

09/28/2023, 2:57 PM
which resource? It's worth doing a
pulumi refresh
to ensure the state is up to date against the service. with
pulumi preview --diff
, it'll show the URNs, are they also the same?
f

fierce-bird-8909

09/28/2023, 2:58 PM
ok will try
yes urns are the same
otherwise it woukld not want to delete the resources right?
d

dry-keyboard-94795

09/28/2023, 2:58 PM
it would delete the resource if the URNs are different
you'd usually see a replace as apposed to a delete+create if they're the same. I've generally always used the
import
resource option instead of
pulumi import
CLI as it gives a bit more flexibility and behaves better with Component Resources.
f

fierce-bird-8909

09/28/2023, 3:06 PM
oh
-- instead of -
well thats the beauty of not beeing chat gpt i guess 😄
d

dry-keyboard-94795

09/28/2023, 3:07 PM
what's that?
f

fierce-bird-8909

09/28/2023, 3:07 PM
the urn
has two dashes in stead of one
as the import and i did not saw that
thank you 😕
d

dry-keyboard-94795

09/28/2023, 3:09 PM
oh haha, no worries. Glad you didn't end up deleting anything
f

fierce-bird-8909

09/28/2023, 3:12 PM
yeah i was just to fast this is production infrastructure we did not set up with pulumi and i import it right now to work with it for customer on boarding
d

dry-keyboard-94795

09/28/2023, 3:12 PM
sometimes it's needed ¯\_(ツ)_/¯