> 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/devops/terraform/terraform-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
