Follow the request/data flow through the architecture.
Work through each concept and mark it understood. This unlocks the knowledge check.
A managed message queue that decouples producers from consumers.
Why it matters
Absorbs bursts and lets components fail/scale independently.
When to use it
Use to buffer work between services (e.g. order spikes on Black Friday).
Gotcha (exam trap)
Standard queues are at-least-once and unordered; use FIFO queues when exactly-once ordering matters. Always add a Dead Letter Queue.
A realistic main.tf for this mission. Read it top to bottom — it mirrors the concepts above.
# Decoupling with SQS & SNS
# BleepxCloud — AWS · Intermediate
# Realistic starter — adapt names, regions and CIDRs to your environment.
terraform {
required_providers { aws = { source = "hashicorp/aws", version = "~> 5.0" } }
}
provider "aws" {
region = "eu-west-1" # pick a region close to users / data-residency rules
}
# FinOps: mandatory cost-allocation tags on every resource.
locals {
common_tags = {
Project = "bleepx-cloud"
Domain = "core"
Mission = "sqs-sns"
ManagedBy = "terraform"
CostCenter = "REPLACE_ME"
}
}
data "aws_caller_identity" "current" {}
# Decoupling queue with a dead-letter queue for poison messages.
resource "aws_sqs_queue" "dlq" { name = "orders-dlq" }
resource "aws_sqs_queue" "orders" {
name = "orders"
visibility_timeout_seconds = 60
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.dlq.arn
maxReceiveCount = 5
})
}
# Fan-out: one topic, many durable SQS subscribers.
resource "aws_sns_topic" "events" { name = "order-events" }
resource "aws_sns_topic_subscription" "to_queue" {
topic_arn = aws_sns_topic.events.arn
protocol = "sqs"
endpoint = aws_sqs_queue.orders.arn
}
Finish the walkthrough above to unlock the check.
Bleepx skills build on each other. Continue your learning path across Query, Lab, and Cloud.