1. Resource address
A resource block names a type (aws_s3_bucket) and a local name (this); together they form its address aws_s3_bucket.this.
resource "aws_s3_bucket" "this" {Typorithm · easy
Step 1 of 8 · intro card
HCL Basics
A resource block has a type and a local name (its address); arguments configure it, and other blocks reference its attributes via type.name.attribute, like aws_s3_bucket.this.arn.
A resource block is the core building block of Terraform — it declares one piece of real infrastructure to create and manage.
Its two labels are the resource type (aws_s3_bucket) and a local name (this); combined they form the resource address aws_s3_bucket.this used everywhere else.
Other expressions reference a resource's exported attributes with type.name.attribute, e.g. aws_s3_bucket.this.arn, and Terraform infers the dependency order from those references.
resource "type" "name" sets the address.
Arguments inside the block configure it.
Reference attributes via type.name.attribute.
resource "aws_s3_bucket" "this" {
bucket = "my-bucket"
tags = {
Env = "prod"
}
}
output "bucket_arn" {
value = aws_s3_bucket.this.arn
}Connect each part of the code to the concept before you type.
A resource block names a type (aws_s3_bucket) and a local name (this); together they form its address aws_s3_bucket.this.
resource "aws_s3_bucket" "this" {Arguments inside the block configure the resource; bucket sets the S3 bucket's name.
bucket = "my-bucket"tags is a map of key/value labels applied to the bucket for cost and ownership tracking.
tags = {
Env = "prod"
}aws_s3_bucket.this.arn reads an exported attribute of the resource, creating an implicit dependency.
value = aws_s3_bucket.this.arnRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.