# Setup Terraform in AWS

**Step 1:** Create a IAM user in AWS. Here is the process to create IAM user. \
[https://app.gitbook.com/o/Sl85xsDKUHFlvowLtBga/s/9wnMXVEmEJ7k6VEhLJYN/\~/changes/kPHMMpBOqOYvqWeP0spW/aws/opennebula-2](https://rajan-silwal-1.gitbook.io/product-docs/cloud-aws/opennebula-1)\
\
**Step 2:** Create one repository in Gitlab, clone that git repo in your local computer. Now, we need to install **AWS extension** on **VS code**. Once you add extension, go to **command palette** and search for **AWS:credentials profile.** Add your **aws\_access\_key\_id** and **aws\_secret\_access\_key.**\
\
**Step 3:** It will ask you to choose your zone. Please select one or more zone that you want to work on.&#x20;

**Step 4:** Open that repository that we create in our local computer.

**Step 5:** Create a file name called **providers.tf** inside our repo. Add following line of code in **providers.tf** which will link to our AWS console.&#x20;

```
# You can find this script in terrafrm page for AWS providers
terraform {
    required_providers {
        aws = {
            source  = "hashicorp/aws"
            version = "~> 4.0"
        }
    }
}
# It will link to our AWS account uisng access_key and secret_key
provider "aws" {
    region     = "us-west-1"
}
```

**Step 6:** Just to confirm we can run **terraform init** in terminal. Now it should show following output: Now, we have successfully initialized our terraform.<br>

<figure><img src="https://1186894440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wnMXVEmEJ7k6VEhLJYN%2Fuploads%2FhgYGQ8fv1jTO8Le41AbC%2FScreen%20Shot%202022-11-06%20at%203.43.11%20PM.png?alt=media&#x26;token=6862a8a5-898f-47bb-9967-98489f4e9527" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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://rajan-silwal-1.gitbook.io/product-docs/automation-tools/terraform/setup-terraform-in-aws.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.
