Language

Remote State & Teams · Lesson 25 of 30

S3 + DynamoDB Backend

Source: doonops-curriculum/remote-state--s3-dynamodb-backend.md

Doonops lesson

Goal

Team shares one state file in S3 — with lock so two people do not apply together.

Simple explanation

State in cloud drawer (S3). DynamoDB lock = "occupied" sign on drawer.

Technical view

State in cloud drawer (S3). DynamoDB lock = "occupied" sign on drawer.

Think of it like

State in cloud drawer (S3). DynamoDB lock = "occupied" sign on drawer.

Steps

  1. Read simple section
  2. Read analogy + diagram
  3. Copy project files
  4. Do local lab

Deep explanation

Layman words first, then technical detail — read slowly

bootstrap bucket+table once. init -migrate-state moves local state up.

Example (Doonops)

Modern HCL — names are examples, not from any third-party course

Example HCL
HCL
# see project files

Terraform runs on your computer — copy this HCL into a folder, then follow the local lab steps below.

Quick check

  • Explain topic to a friend in 2 sentences
  • Did local lab steps

Project files for this lab

Full implementation folder — copy all files, then run terraform commands

Lab project files (full folder)

Copy every file below into one folder — same as a real repo module. Then run the local lab steps.

Suggested folder: Suggested path: ~/doonops-terraform/22-remote-backend/

versions.tfSee file purpose in the code below
terraform {
  required_version = ">= 1.9.0"
}