Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ECR Repository - This is where we store our Docker images
# Think of it like a private Docker Hub for AWS
# It is like a private Docker Hub for AWS

resource "aws_ecr_repository" "beer_app" {
name = "${var.project_name}-app"
Expand All @@ -9,11 +9,16 @@ resource "aws_ecr_repository" "beer_app" {
encryption_type = "AES256"
}

# Force delete even if repository contains images
force_delete = true

# This adds a tag to help us identify it
tags = {
Name = "Beer Catalog App Repository"
}
}


# ECS Task Execution Role - Allows ECS tasks to pull images from ECR and write logs
resource "aws_iam_role" "ecs_task_execution" {
name = "${var.project_name}-ecs-task-execution-role"
Expand Down Expand Up @@ -83,7 +88,7 @@ resource "aws_ecs_task_definition" "app" {
awslogs-stream-prefix = "ecs"
}
}
essential = true
essential = true # This makes sure the container is running
}
])
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/providers.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Provider Configuration - This tells Terraform how to connect to AWS
# Think of it like connecting to the kitchen before you can cook

provider "aws" {
region = var.aws_region
}