# Replace terraform with tofu
alias terraform=tofu # Everything works the same
tofu init
tofu plan
tofu apply
# Replace terraform with tofu
alias terraform=tofu # Everything works the same
tofu init
tofu plan
tofu apply
# Replace terraform with tofu
alias terraform=tofu # Everything works the same
tofu init
tofu plan
tofu apply
# main.tf
resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t3.micro" tags = { Name = "web-server" }
} resource "aws_s3_bucket" "assets" { bucket = "my-app-assets"
} resource "aws_rds_instance" "db" { engine = "postgres" engine_version = "16" instance_class = "db.t3.micro" allocated_storage = 20
}
# main.tf
resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t3.micro" tags = { Name = "web-server" }
} resource "aws_s3_bucket" "assets" { bucket = "my-app-assets"
} resource "aws_rds_instance" "db" { engine = "postgres" engine_version = "16" instance_class = "db.t3.micro" allocated_storage = 20
}
# main.tf
resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t3.micro" tags = { Name = "web-server" }
} resource "aws_s3_bucket" "assets" { bucket = "my-app-assets"
} resource "aws_rds_instance" "db" { engine = "postgres" engine_version = "16" instance_class = "db.t3.micro" allocated_storage = 20
}
tofu plan # Preview changes
tofu apply # Create infrastructure
tofu destroy # Tear it all down
tofu plan # Preview changes
tofu apply # Create infrastructure
tofu destroy # Tear it all down
tofu plan # Preview changes
tofu apply # Create infrastructure
tofu destroy # Tear it all down
# Create staging identical to production
tofu workspace new staging
tofu apply -var="environment=staging"
# Create staging identical to production
tofu workspace new staging
tofu apply -var="environment=staging"
# Create staging identical to production
tofu workspace new staging
tofu apply -var="environment=staging"
# macOS
-weight: 500;">brew -weight: 500;">install opentofu # Linux
-weight: 500;">curl -fsSL https://get.opentofu.org/-weight: 500;">install-opentofu.sh | sh
# macOS
-weight: 500;">brew -weight: 500;">install opentofu # Linux
-weight: 500;">curl -fsSL https://get.opentofu.org/-weight: 500;">install-opentofu.sh | sh
# macOS
-weight: 500;">brew -weight: 500;">install opentofu # Linux
-weight: 500;">curl -fsSL https://get.opentofu.org/-weight: 500;">install-opentofu.sh | sh - New projects (-weight: 500;">start with open source)
- Companies concerned about license changes
- Need state encryption (free in OpenTofu, paid in Terraform) - Terraform Cloud user (deep integration)
- Existing team already trained on Terraform
- Need Sentinel policies (HashiCorp-specific)