https://pulumi.com logo
Title
g

gifted-room-26715

03/23/2023, 5:55 AM
Hello folks, I want to import GCP resources that are created through console. Is there a reference doc that lists how to reference each and every gcp resource through its ID? For instance what is the correct command for importing instanceGroup as the below one continues to state the referenced resource doesn't exist even though it is already created and used. pulumi import gcp:compute/instanceGroup:InstanceGroup my-instance-group projects/my-project/zones/us-central1-a/instanceGroups/my-instance-group I've tried with zone and regions variations and also with InstanceGroupManager but so far no luck.
s

stocky-restaurant-98004

03/23/2023, 2:06 PM
If you're working with a bunch of resources, this blog post and the accompanying code should be helpful: https://www.pulumi.com/blog/google-cloud-pulumi-import-account-scraper/
If you're doing a small number of resources, the ID is always whatever the docs say for the Import command.
g

gifted-room-26715

03/24/2023, 4:39 AM
@stocky-restaurant-98004 How do I get the ID of a resource using pulumi import? This is what I'm trying to figure out.
s

stocky-restaurant-98004

03/24/2023, 1:47 PM
Check the docs for the resource in question. Example: https://www.pulumi.com/registry/packages/gcp/api-docs/compute/network/#import