# Getting Started with Terraform and Twingate

Terraform (from HashiCorp) is a well known Infrastructure as Code platform that can be used to automate entire Twingate environments.

## Infrastructure as Code

**Infrastructure as code** (or IaC) is fast becoming the must have method for deploying and managing infrastructure. Most, if not all, cloud infrastructure service companies offer a way to deploy and configure infrastructure via declarative code.

Below you will find guides on how to deploy Twingate to the “big three” cloud providers:

- [GCP](/content/docs/terraform-gcp/index.html)
- [AWS](/content/docs/terraform-aws/index.html)
- [Azure](/content/docs/terraform-azure/index.html)

All guides cover the deployment of the following infrastructure using Terraform:

[Peer-to-peer connections](/content/docs/peer-to-peer-communication-in-twingate/index.html) help you to provide a better experience for your users and to stay within the [Fair Use Policy](/content/terms/sa/index.html) for bandwidth consumption. Learn how to [support peer-to-peer connections](/content/docs/troubleshooting-p2p/index.html).

#### Twingate

- A new Twingate Remote Network
- A new Twingate connector (attached to the Remote Network)
- Access and refresh tokens created for the new connector
- New Twingate resource for newly created Nginx virtual machine
- New Twingate group for accessing new network and resource

#### Cloud Provider (GCP, AWS, Azure)

- A new VPC
- A new subnet in this VPC
- Firewall rules
- A new virtual machine with the Twingate connector installed and configured
- A new virtual machine with Nginx installed and started

## Recommended Tools

During this guide we will be using the following:

- [Visual Studio Code](https://code.visualstudio.com/) (IDE, recommended but any text editor can be used)
- [Terraform](https://www.terraform.io/downloads) (IaC)
- Twingate API (and the Terraform Provider)
- Twingate Client

#### Setup 💪

Before we going into the step-by-step guides, make sure the following is setup:

- ✅ vscode or other text editor installed
- ✅ Terraform installed
- ✅ Twingate client installed

Last updated 5 months ago
