> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/devops/terraform/terraform-components.md).

# Terraform components

### Provider

* The Terraform provider is basically a way that allows you to interact with the API endpoints of different cloud providers or apps or even on-prem providers such as VMWare

```hcl
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Configure the AWS Provider
provider "aws" {
  region = "us-east-1"
}
```

### State

* The file <mark style="color:orange;">`terraform.tfstate`</mark> is where the resources that are deployed are kept track of
* We can see all or most information here as well as in the cloud

<figure><img src="/files/uKqj2WYU25qzlxqckoD2" alt=""><figcaption></figcaption></figure>

#### We have a few CLI tools that allows us to interact with the TFState file

```bash
# This allows us to list the resources:
terraform state list

# We can get the info from a resource by running the following:
terraform state show <resource_name>

# If you want to view the entire state:
terraform show
```
