How to launch an instance in GCP using Terraform

0 votes
Hi Guys,

I want to launch one instance on the GCP cloud using Terraform. How can I do that?
Sep 11, 2020 in Terraform by akhtar
• 38,260 points
854 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the google_compute_instance resource in Terraform. This resource has the capability to launch an instance n GCP Cloud. You can see the below example.

resource "google_compute_instance" "vm_instance" {
  name         = "terraform-instance"
  machine_type = "f1-micro"
  zone = "us-central1-a"
  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-9"
    }
  }
  network_interface {
    # A default network is created for all GCP projects
    network = "default"
    access_config {
    }
  }
answered Sep 12, 2020 by MD
• 95,460 points

Related Questions In Terraform

0 votes
1 answer

How to do ssh in EC2 instance using Terraform?

Hi@akhtar, To ssh in your EC2 instance, you ...READ MORE

answered Jun 15, 2020 in Terraform by MD
• 95,460 points
7,210 views
0 votes
1 answer

How to launch one Pod in Minikube using Terraform?

Hi@akhtar, You can use kubernetes_pod resource to launch ...READ MORE

answered Jun 16, 2020 in Terraform by MD
• 95,460 points
3,404 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,460 points
2,683 views
0 votes
1 answer

How to launch EC2 windows instance with powershell script using terraform?

Hi, In your Terraform code, you have written ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,460 points
4,361 views
0 votes
1 answer

Create a project in GCP using Terraform.

Hi@akhtar, Terraform has a resource named google_project. This ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
1,004 views
0 votes
1 answer

How to set an IAM policy for a project in GCP using Terraform?

Hi@akhtar, You can create a policy and give ...READ MORE

answered Sep 13, 2020 in Terraform by akhtar
• 38,260 points
1,599 views
0 votes
2 answers

How to create a customized IAM policy in GCP using Terraform?

You can visit Terraform official site for ...READ MORE

answered Sep 14, 2020 in Terraform by Peter
• 180 points
1,859 views
0 votes
1 answer

How to create a security rule in GCP using Terraform?

Hi@akhtar, A Security Policy defines an IP blacklist ...READ MORE

answered Sep 14, 2020 in Terraform by MD
• 95,460 points
1,293 views
0 votes
1 answer

How to create Filestore instance in GCP using Terraform?

Hi@akhtar, You can manage services in the GCP ...READ MORE

answered Sep 14, 2020 in Terraform by MD
• 95,460 points
2,636 views
0 votes
1 answer

How to attach an EBS volume to EC2 instance using terraform?

Hi@akhtar, You can use aws_volume_attachment resource to attach ...READ MORE

answered Jun 12, 2020 in Terraform by MD
• 95,460 points
8,894 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP