https://pulumi.com logo
Title
h

high-pencil-44536

04/19/2022, 4:33 PM
I'm new to Pulumi and I'm having trouble importing an existing folder into my Pulumi stack:
bran@danforth infra % pulumi import google-native:cloudresourcemanager/v3:Folder non_production 250711497935
Previewing import (shared):
     Type                                             Name            Plan       Info
     pulumi:pulumi:Stack                              infra-shared               1 error
 =   └─ google-native:cloudresourcemanager/v3:Folder  non_production  import     1 error

Diagnostics:
  pulumi:pulumi:Stack (infra-shared):
    error: preview failed

  google-native:cloudresourcemanager/v3:Folder (non_production):
    error: Preview failed: property "foldersId"/"name" not found
Whats the right incantation here or is this a bug?
e

eager-keyboard-30823

04/19/2022, 6:11 PM
Looks like it’s complaining about the format of the last argument in that call
I haven’t used cloudresourcemanager in pulumi yet but let me check if I can find the right one for you, one sec
Well, I don’t have that in my project, but I’m assuming you just need to find out what the name of your folder is and add that so your command looks like
pulumi import google-native:cloudresourcemanager/v3:Folder non_production 250711497935/{{name}}
h

high-pencil-44536

04/19/2022, 6:19 PM
Hm, doesn't seem to work for me
bran@danforth infra % pulumi import google-native:cloudresourcemanager/v3:Folder non_production '250711497935/Non-Production'
Previewing import (shared):
     Type                                             Name            Plan       Info
     pulumi:pulumi:Stack                              infra-shared               1 error
 =   └─ google-native:cloudresourcemanager/v3:Folder  non_production  import     1 error

Diagnostics:
  pulumi:pulumi:Stack (infra-shared):
    error: preview failed

  google-native:cloudresourcemanager/v3:Folder (non_production):
    error: Preview failed: property "foldersId"/"name" not found
e

eager-keyboard-30823

04/19/2022, 6:20 PM
I don’t think you need the single quotes around the last bit, not sure if that makes a difference though
h

high-pencil-44536

04/19/2022, 6:32 PM
Yeah the quotes get evaluated by the shell before it gets to the pulumi process.
👍 1
e

eager-keyboard-30823

04/19/2022, 6:33 PM
Got no idea what might be wrong then, sorry. 🤷
h

high-pencil-44536

04/19/2022, 7:24 PM
was able to get this to work with the pulumi_gcp (classic) package
🙌 1