Build Infrastructure with Terraform on Google Cloud: Challenge Lab Reviews
Loading...
No results found.

    Build Infrastructure with Terraform on Google Cloud: Challenge Lab Reviews

    83061 reviews

    Rafael Z. · Reviewed 24 days ago

    Saranya P. · Reviewed 24 days ago

    CESAR C. · Reviewed 24 days ago

    enzo d. · Reviewed 24 days ago

    Carlos V. · Reviewed 24 days ago

    Wisdom O. · Reviewed 24 days ago

    Arie Anjasmara C. · Reviewed 24 days ago

    Deni Rusmana C. · Reviewed 24 days ago

    Andre F. · Reviewed 24 days ago

    Excellent lab!

    Mykhailo V. · Reviewed 24 days ago

    KRISHNA R. · Reviewed 24 days ago

    Muhammad Malik Ibrahim Baharsyah C. · Reviewed 24 days ago

    Havacs G. · Reviewed 24 days ago

    Rakesh Bhagavan V. · Reviewed 24 days ago

    Ganga Ramesh J. · Reviewed 24 days ago

    Bartosz S. · Reviewed 24 days ago

    VASANTHI S. · Reviewed 24 days ago

    47_Harsh J. · Reviewed 24 days ago

    Pradip R. · Reviewed 24 days ago

    Fitri Sri Mulyani C. · Reviewed 24 days ago

    Gokulraj A. · Reviewed 24 days ago

    Lalitha G. · Reviewed 24 days ago

    Tawatchai W. · Reviewed 24 days ago

    corrector does not accept anything, maybe needs help, here my solution (some points are unclear, import paths changed e.g. api changed)# lab Build Infrastructure with Terraform on Google Cloud with Shell mkdir modules mkdir modules/instances mkdir modules/storage touch main.tf touch variables.tf touch modules/instances/instances.tf touch modules/instances/outputs.tf touch modules/instances/variables.tf touch modules/storage/storage.tf touch modules/storage/outputs.tf touch modules/storage/variables.tf nano variables.tf variable "region" { type = string description = "region" default = "us-central1" } variable "zone" { type = string description = "zone within the range" default = "us-central1-c" } variable "project_id" { description = "project id" default = "qwiklabs-gcp-02-4341b293f901" } save and exit nano modules/instances/variables.tf input variable "region" { type = string description = "region" default = "" } variable "zone" { type = string description = "zone within the range" default = "" } variable "project_id" { description = "project id" default = "" } save and exit nano modules/storage/variables.tf input variable "region" { type = string description = "region" default = "" } variable "zone" { type = string description = "zone within the range" default = "" } variable "project_id" { description = "project id" default = "" } save and exit nano main.tf # unclear terraform { required_providers { google = { source = "hashicorp/google" version = "3.55.0" } } } provider "google" { project = var.project_id region = var.region zone = var.zone } #unclear module "instances" { source = "./modules/instances" } module "storage" { source = "./modules/storage" } #or (tried 1) module "instances" { source = "./modules/instances" name = var.name project_id = var.project_id location = "US" } module "storage" { source = "./modules/storage" name = var.name project_id = var.project_id location = "US" } save and exit terraform init # Get the ID of tf-instance-1 and tf-instance-2 5644271441688324376 3921379150945249560 nano modules/instances/instances.tf ##unclear Image path gcloud compute instances create instance-20241025-091548 --project=qwiklabs-gcp-02-4341b293f901 --zone=us-central1-c --machine-type=e2-medium --network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default --metadata=enable-oslogin=true --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=977418659603-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=instance-20241025-091548,image=projects/debian-cloud/global/images/debian-11-bullseye-v20241009,mode=rw,size=10,type=pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any ## resource "google_vm_instance" "tf-instance-1" { name = "tf-instance-1" machine_type = "e2-micro" boot_disk { initialize_params { image = "projects/debian-cloud/global/images/debian-11-bullseye-v20241009" } } network_interface { network = "default" } metadata_startup_script = <<-EOT #!/bin/bash EOT allow_stopping_for_update = true } resource "google_vm_instance" "tf-instance-2" { name = "tf-instance-2" machine_type = "e2-micro" boot_disk { initialize_params { image = "projects/debian-cloud/global/images/debian-11-bullseye-v20241009" } } network_interface { network = "default" } metadata_startup_script = <<-EOT #!/bin/bash EOT allow_stopping_for_update = true } save and Exit # unclear if needed cd ~ # from get id does not work 5644271441688324376 3921379150945249560 terraform import module.instances.google_compute_instance.tf-instance-1 5644271441688324376 terraform import module.instances.google_compute_instance.tf-instance-2 3921379150945249560 terraform plan terraform apply nano modules/storage/storage.tf resource "google_storage_bucket" "storage-bucket" { name = "" location = "US" force_destroy = true uniform_bucket_level_access = true } save and exit #unclear which main.tf, assuming the one in the root; unclear what to add to module reference nano main.tf module "storage" { source = "./modules/storage" } save, Exit terraform init terraform apply nano main.tf # within terraform backend "gcs" { bucket = "" prefix = "terraform/state" } save, Exit terraform init # step 4 nano modules/instances/instances.tf # Change machine type to e2-standard-2 from tf-instance-1, tf-instance-2 resource "google_compute_instance" "tf-instance-3" { name = "" machine_type = "e2-standard-2" boot_disk { initialize_params { image = "" } } network_interface { network = "default" } metadata_startup_script = <<-EOT #!/bin/bash EOT allow_stopping_for_update = true } terraform init terraform apply # step 5 nano modules/instances/instances.tf delete tf-instance-3 terraform init terraform apply #step 6 unclear 6.0 or 6.0.0, maybe Region attention module "vpc" { source = "terraform-google-modules/network/google" version = "~> 6.0.0" project_id = var.project_id network_name = "" routing_mode = "GLOBAL" subnets = [ { subnet_name = "subnet-01" subnet_ip = "10.10.10.0/24" subnet_region = "us-west1" }, { subnet_name = "subnet-02" subnet_ip = "10.10.20.0/24" subnet_region = "us-west1" subnet_private_access = "true" subnet_flow_logs = "true" description = "This subnet has a description" } ] } terraform init terraform apply nano modules/instances/instance.tf network_interface { network = "" subnetwork = "subnet-01" } network_interface { network = "" subnetwork = "subnet-02" } terraform init terraform apply resource "google_compute_firewall" "tf-firewall" { name = "tf-firewall" network = projects/ /global/networks/ allow { protocol = "icmp" } allow { protocol = "tcp" ports = ["80", "8080", "1000-2000"] } source_tags = ["web"] source_ranges = ["0.0.0.0/0"] } terraform init terraform apply

    Christian W. · Reviewed 24 days ago

    Lalitha G. · Reviewed 24 days ago

    We do not ensure the published reviews originate from consumers who have purchased or used the products. Reviews are not verified by Google.