[Terraform](https://www.terraform.io/)
is an infrastructure-as-code (IaC) tool that you can use to provision resources
and permissions for Cloud Workstations.
To use Terraform with Cloud Workstations, you need to
[create a configuration file](https://developer.hashicorp.com/terraform/language)
to describe your infrastructure, and then
[apply the configuration file](https://developer.hashicorp.com/terraform/cli/commands/apply)
to create an execution plan and perform operations to provision your
infrastructure.

For example, you can use Terraform to create workstations,
create various workstation configurations (templates), and
create workstation configurations for public or private workstation clusters.

## Terraform resources for Cloud Workstations

The following table lists Cloud Workstations configuration samples that
appear in the [Terraform registry](https://developer.hashicorp.com/terraform/language/resources)
and from [GitHub](https://github.com/terraform-google-modules/docs-examples).

| **Cloud Workstations resource** | **Terraform registry sample** |
|---|---|
| Cluster | Basic [google_workstations_workstation_cluster](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_cluster#example-usage---workstation-cluster-basic) |
| Cluster | Private [google_workstations_workstation_cluster](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_cluster#example-usage---workstation-cluster-private) |
| Basic workstation configuration | [google_workstations_workstation_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_config#example-usage---workstation-config-basic) |
| Workstation configuration with additional features | From a container: [google_workstations_workstation_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_config#example-usage---workstation-config-container) |
| Workstation configuration with additional features | With persistent directories: [google_workstations_workstation_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_config#example-usage---workstation-config-persistent-directories) |
| Workstation configuration with additional features | With shielded instance configuration: [google_workstations_workstation_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_config#example-usage---workstation-config-shielded-instance-config) |
| Workstation configuration with additional features | With customer-managed encryption keys (CMEK) [google_workstations_workstation_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation_config#example-usage---workstation-config-encryption-key) |
| Workstation | [google_workstations_workstation](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workstations_workstation) |

## What's next

Learn more about Terraform:

- [What is Terraform?](https://developer.hashicorp.com/terraform/intro)

- [Terraform registry](https://registry.terraform.io/providers/hashicorp/google/latest/docs/)

- [Terraform Developer website](https://developer.hashicorp.com/terraform/)

- [Terraform Language Documentation](https://developer.hashicorp.com/terraform/language)

- [Terraform CLI Documentation](https://developer.hashicorp.com/terraform/cli)