-
Open VSCode and click on "File."
-
Click on "Preferences."
-
Click on "Configure User Snippets."
-
Choose a name for the file.
The file will be created with the following name: .code-snippets.
-
Copy and paste the code from the main file "terraform-snippets.code-snippets" into the file you generated, overwriting it.
-
Save the file.
That's it! Now you can use the following snippets:
["variable", "var"]to create generic variables.varstrfor string variables.varnumfor numeric variables.["pool-disks", "sec-disk", "vardisks"]for a pool of secondary disks.["google_compute_instance", "compute_instance"]to create a compute instance.["terraform-google-vpc", "vpc", "compute_network"]to create a VPC.["terraform-google-subnetwork", "sn", "compute_subnetwork"]to create a subnetwork.["terraform-google-disk", "disk", "compute_disk"]to create a disk.["terraform-google-bucket", "bucket", "mb"]to create a bucket.["gke-node-pull", "gke-pool", "node_pool", "pool"]to create a GKE node pool.public-ipto create a public IP.cloud-sqlto create a Cloud SQL instance.["gke", "cluster", "gke-cluster"]to create a GKE cluster.["firewall", "firewall-rule", "rule"]to create a firewall rule.["load-balancer", "lb"]to create a load balancer.attach-diskto attach disks.