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