> For the complete documentation index, see [llms.txt](https://docs.terraforge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terraforge.io/tutorials/aws-stack/3-terraform-aws-stack-ecr/3.1-terraform-code.md).

# 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
