https://pulumi.com logo
Title
d

dry-keyboard-94795

12/12/2022, 2:53 PM
When using the
import
for ResourceOptions, is there a quick way to see what the differences are when presented with this warning?
warning: inputs to import do not match the existing resource; importing this resource will fail
this is for a
gcp.storage.Bucket
resource
b

broad-dog-22463

12/12/2022, 2:55 PM
you should be able to run a pulumi import and then look atthe details
it will give you a plan of what the import is and should give you the ability to test the details
d

dry-keyboard-94795

12/12/2022, 3:04 PM
any way to generate the code without having the resource loaded into state?
b

broad-dog-22463

12/12/2022, 3:05 PM
there's no dry run I'm afraid 😕
d

dry-keyboard-94795

12/12/2022, 3:05 PM
because right now, that would be massively useful (currently loading existing infrastructure into pulumi)
b

broad-dog-22463

12/12/2022, 3:05 PM
you can import it to an empty project, generate the code and remove the stack without running pulumi destroy
and it will do the same thing for you
d

dry-keyboard-94795

12/12/2022, 3:06 PM
yeah, thought that might be the workaround 😆
b

broad-dog-22463

12/12/2022, 3:06 PM
I wish I had better news 😄
d

dry-keyboard-94795

12/12/2022, 3:07 PM
I think Bucket imports might be broken when they have a cors policy set actually, always shows a diff (even if the code has
cors
unset). Will confirm in a minute
nope, works fine.
cors.method
is a list. To google, the order doesn't matter. But to pulumi, the order does matter. It'd be great to see resource diffs for imports though! I'm trying to keep manual operations to a minimum as I'm working across 3 stacks
b

broad-dog-22463

12/12/2022, 3:14 PM
I'm sure if you have suggestions, the team would love an issue in pulumi/pulumi repo with some good details on the use case 🙂
d

dry-keyboard-94795

12/12/2022, 3:17 PM
alas, it's a usecase we won't care about by the end of the year, as all the resources will already be managed by Pulumi. So I won't make a good stakeholder 🙂
b

broad-dog-22463

12/12/2022, 3:17 PM
You'd be surprised 🙂
d

dry-keyboard-94795

12/12/2022, 3:38 PM
Found out the diff does actually show for imports in the CLI output, just not in the pulumi dashboard