https://pulumi.com logo
Title
s

straight-intern-54129

06/28/2021, 9:13 PM
I'm trying to use
pulumi import
to import an existing Azure resource group. I'm trying to specify the resource group as the
--parent
but am getting
error: an inline resource must be specified if no import file is used.
Is there an example of importing an Azure resource that I can compare against?
I'm not clear on what the "type" should be for an Azure resource group.
Also not sure if I can just use the resource group name or something more fully qualified
r

red-match-15116

06/28/2021, 9:34 PM
what are you trying?
what resource are you trying to import?
oh right the resource group, sorry. I’m not sure what you mean by
I’m trying to specify the resource group as the 
--parent
Are you using the azure-native provider?
Can you tell me what you tried that resulted in that error?
https://www.pulumi.com/docs/reference/pkg/azure-native/resources/resourcegroup/#import The format is:
pulumi import [type] [name] [id]
So:
pulumi import azure-native:resources:ResourceGroup myResourceGroup /subscriptions/{subscription-id}/resourceGroups/myResourceGroup
s

straight-intern-54129

06/28/2021, 9:46 PM
Ah ok let me try it with that type...
I tried this:
pulumi import azure-native:resources:ResourceGroup "/subscriptions/{subscription guid}/resourceGroups/{resource group name}"
but no go
oh wait, I am missing the
id
argument
r

red-match-15116

06/28/2021, 9:50 PM
you’re missing the name arg, you have
pulumi import [type] [id]
name
is what you would like to call the resource in your pulumi program
s

straight-intern-54129

06/28/2021, 9:51 PM
ah ok..
It's importing! yay
🎉 1
Thank you very much
1
😛artypus-8bit: 1