Hi all, I'm running into an issue importing existi...
# azure
c
Hi all, I'm running into an issue importing existing resources from azure. For example, if I try to import a VirtualNetworkGateway, I'm getting the following error:
Copy code
Diagnostics:
  azure:network:VirtualNetworkGateway (cgw-snm-net-blue):
    error: azure:network/virtualNetworkGateway:VirtualNetworkGateway resource 'cgw-snm-net-blue' has a problem: Missing required property 'type'
    error: azure:network/virtualNetworkGateway:VirtualNetworkGateway resource 'cgw-snm-net-blue' has a problem: Missing required property 'sku'
    error: azure:network/virtualNetworkGateway:VirtualNetworkGateway resource 'cgw-snm-net-blue' has a problem: Missing required property 'ipConfigurations'
    error: Preview failed: one or more inputs failed to validate

  pulumi:pulumi:Stack (autopilot-azure-autopilot-azure):
    error: preview failed
Interestingly enough though, if I look at the debug output, it does have a type, sku and ip configurations. What would be the recommended way moving forward? Just trying to import the resource manually by patching the stack?
t
Could you show me your code for
VirtualNetworkGateway
?
c
do you mean, the code that imports the resource? because I haven't written the code for the resource yet. It's been manually clicked together by somebody and I need to absorb it into my code
Note, it's not just with VirtualNetworkGateway's that i'm running into this problem, also with LocalNetworkGateway
t
How are you running the import?
c
I've tried the pulumi command line, so
Copy code
pulumi import azure:network/virtualNetworkGateway:VirtualNetworkGateway cgw-snm-net-blue /subscri....
or via a json file
t
And then copying the resulting code to your program?
c
yes, that's the process that i'm following right now, just to get the skeleton
then I can do some cleanups..
t
So, could you show me that code that you pasted?
c
the import isn't generating any code for this resource, as it's failing
t
That’s the problem then
c
thing is, if I write the code without importing, i worry it will create a duplicate resource
t
You could write your code manually but add
ImportId
option to the resource
c
I'll give that a try
c
I was just reading that bit as well
t
But please open an issue for the failing import command: that sounds like a bug somewhere
c
cool, I'll do that! Thanks. I'll also add the resolution if it works by manually writing the code
So writing the code myself works. I'll file a bug for the code gen issue
👍 1