Skip to main content
This example demonstrates how to create a basic Google Cloud (GCP) infrastructure including a VPC network, a firewall rule, and a compute instance. It also shows how to configure a GCS backend for state management.

Prerequisites

Ensure you have the Google provider generated in your project:

Complete Example

Key Concepts

  • Provider Configuration: The GoogleProvider requires a project ID and a default region.
  • Backend Configuration: GcsBackend stores the state in a Google Cloud Storage bucket.
  • Network Interface: In GCP, the networkInterface block is used to connect the instance to a VPC. Including an empty accessConfig block ensures the instance gets a public IP address.
  • Boot Disk: The bootDisk property defines the operating system image and disk size for the instance.