# 3.1 - Terraform Code

{% embed url="<https://beta-terraforge-public-assets.s3.amazonaws.com/aws-stack-3.1-terraform-code.mp4>" %}

## Steps

1. Select **main.tf** in the file tree and add the following Terraform code:\
   `provider "aws" {`\
   &#x20; `region = var.aws_region`\
   `}`
2. Click **SAVE**
3. Select **variables.tf** in the file tree and the following Terraform code:\
   `variable "aws_region" {`\
   \
   `}`
4. Click **+ ADD**  and select **Terraform File** and set **File Path** to `ecr.tf`
5. Add the following Terraform code:\
   `resource "aws_ecr_repository" "tutorial" {`\
   &#x20; `name = "tutorial"`\
   `}`
6. Click **ADD** (or **SAVE**)
7. Click on **FORM** on the top-right corner to use the resource builder
8. Click on **DOCS** on the top-right corner to see the Terraform documentation for this resource


---

# 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://docs.terraforge.io/tutorials/aws-stack/3-terraform-aws-stack-ecr/3.1-terraform-code.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.
