> For the complete documentation index, see [llms.txt](https://asafahmadov.gitbook.io/cloud-and-devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/infrastructure-as-code-with-terraform/providers.md).

# Providers

▪ Plugins Terraform uses to manage the resources&#x20;

&#x20;   ▪ Providers expose resources for specific infrastructure platform (e.g. AWS)&#x20;

&#x20;   ▪ <mark style="color:red;">**Responsible for understanding API of that platform**</mark>&#x20;

&#x20;   ▪ Just code that knows how to talk to specific technology or platform

![](/files/DtQjs6JCjxOmsMg5XsBt)

### Provision AWS EC2 Instance Using Terraform <a href="#h-provision-aws-ec2-instance-using-terraform" id="h-provision-aws-ec2-instance-using-terraform"></a>

Create a working directory for this Terraform demo.

```
geekflare@geekflare:~$ mkdir terraform_demo
```

Go to the directory and create a terraform configuration file where you define the provider and resources to launch an AWS EC2 instance.

```
geekflare@geekflare:~$ cd terraform_demo/
geekflare@geekflare:~/terraform_demo$ gedit awsec2.tf

provider "aws" {
access_key = "B5KG6Fe5GUKIATUF5UD"
secret_key = "R4gb65y56GBF6765ejYSJA4YtaZ+T6GY7H"
region = "us-west-2"
}

resource "aws_instance" "terraform_demo" {
ami = "ami-0a634ae95e11c6f91"
instance_type = "t2.micro"
}
```

#### terraform init <a href="#h-terraform-init" id="h-terraform-init"></a>

Now, the first step is to initialize terraform.

```
geekflare@geekflare:~/terraform_demo$ terraform init

Initializing the backend...
```


---

# 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://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/infrastructure-as-code-with-terraform/providers.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.
