Complete the code to define a Google Cloud Storage bucket resource.
resource "google_storage_bucket" "my_bucket" { name = [1] location = "US" }
The bucket name must be a quoted string and globally unique. So, the correct value is a quoted string like "my-unique-bucket-123".
Complete the code to specify the machine type for a Compute Engine instance.
resource "google_compute_instance" "vm_instance" { name = "vm-1" machine_type = [1] zone = "us-central1-a" }
The machine_type must be a string enclosed in quotes, such as "n1-standard-1".
Fix the error in the resource definition by completing the missing field for network interface.
resource "google_compute_instance" "vm_instance" { name = "vm-2" machine_type = "e2-medium" zone = "us-west1-b" network_interface { network = [1] } }
The network field requires a string with the network name, usually "default" for the default network.
Fill both blanks to define a firewall rule allowing HTTP traffic.
resource "google_compute_firewall" "allow_http" { name = "allow-http" network = [1] allow { protocol = [2] ports = ["80"] } }
The firewall rule applies to the "default" network and allows TCP protocol on port 80 for HTTP traffic.
Fill all three blanks to define a Cloud SQL instance with MySQL database version and region.
resource "google_sql_database_instance" "db_instance" { name = [1] database_version = [2] region = [3] }
The instance name must be a quoted string like "my-db-instance". The database version is "MYSQL_8_0" for MySQL 8.0, and the region is "us-central1".