Terraforge
  • Welcome to Terraforge!
  • Features
  • How it works
  • HashiCorp Meetup Slides
  • Demos & Tutorials
    • First Steps
      • 1 - Tutorial Environment
      • 2 - Terraform Stack (local_file)
        • 2.1 - Source Code Editor
        • 2.2 - Terraform validate & plan
        • 2.3 - README
      • 3 - Pipeline Apply
    • AWS Stack (simple)
      • 1 - Terraform user
      • 2 - Sandbox Environment
      • 3 - Terraform Stack (ECR registry)
        • 3.1 - Terraform Code
        • 3.2 Terraform validate & plan
      • 4 - Pipeline Apply
      • 5 - Pipeline Destroy
Powered by GitBook
On this page

Was this helpful?

  1. Demos & Tutorials
  2. AWS Stack (simple)
  3. 3 - Terraform Stack (ECR registry)

3.1 - Terraform Code

Goal: Create a Terraform provider / resource / variable

Previous3 - Terraform Stack (ECR registry)Next3.2 Terraform validate & plan

Last updated 5 years ago

Was this helpful?

Steps

  1. Select main.tf in the file tree and add the following Terraform code: provider "aws" { 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" { 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