Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. ›
  3. posts
  4. ›
  5. …

  6. ›
  7. CLI

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🍌 Bananas are berries, but strawberries are not.

🍪 This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🦥 Sloths can hold their breath longer than dolphins 🐬.
Terraform

    AI-AgenticAI

    AI-DeepLearning

    AI-GenAI

    AI-Infrastructure

    AI-Machine-Learning

    AI-Math

    AWS

    Azure

    kubernetes

    Management

    Programming

    Terraform
    • Terraform Certification Path


    • Terraform Basics


    • Terraform Configuration Management


    • TF Modules: How to Use & Create


    • TF State & Backend Management


    • Terraform Core Workflow & Commands


    • IaC Concepts & TF Overview


    • TF Cloud Capabilities & Workflow


    • TF CMD Cheatsheet


    • Terraform Index


    Z_Appendix

Cover Image for TF CMD Cheatsheet
Terraform

TF CMD Cheatsheet

Quick reference for commonly used TF string functions. Learn how to manipulate strings efficiently in your Terraform configurations with this handy cheatsheet.

Terraform
Cloud
Infrastructure as Code
IaC
DevOps
← Previous

Terraform Certification Path

Next →

Kubernetes: Control Loops, Scheduling, and GPUs

📝 TF CMD Cheatsheet: String Functions

funcoutputusage
startswith("hello world", "hello")true
endswith("hello world", "world")true
upper("hello") HELLO
lower("HELLO")hello
strrev("hello")olleh
substr("hello world", 1, 4)ello
title("hello world")Hello World
trim("?!hello?!", "!?")helloRemoves the specified set of characters from the start and end of the given string.
trimsuffix("helloworld", "world")helloremoves the specified suffix from the end of the given string.
trimprefix("helloworld", "hello")worldremoves the specified prefix from the start of the given string.
trimspace(" hello\n\n") helloremoves any space characters from the start and end of the given string.
indent(2, "[\n foo,\n bar,\n]\n")"[\n foo,\n bar,\n ]\n"adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
join("-", ["foo", "bar", "baz"])"foo-bar-baz"produces a string by concatenating all of the elements of the specified list of strings with the specified separator.
replace("1 + 2 + 3", "+", "-")1 - 2 - 3searches a given string for another given substring, and replaces each occurrence with a given replacement string.
split(",", "foo,bar,baz")["foo","bar","baz",]produces a list by dividing a given string at all occurrences of a given separator.

Related Posts

  • Terraform Core Workflow & Commands — the workflow context for these CLI commands: when to use plan -out, apply tfplan, and workspace switching
  • Terraform Configuration Management — the HCL language constructs (variables, outputs, functions) that these CLI commands operate on
  • TF State & Backend Management — terraform state sub-commands and -refresh-only for drift detection
Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Fri Feb 20 2026

Share This on

← Previous

Terraform Certification Path

Next →

Kubernetes: Control Loops, Scheduling, and GPUs

Terraform/CLI
Let's work together
hiteshkrsahu@gmail.com
Munich 🥨, Germany 🇩🇪, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
  Home/About
  Skills
  Work/Projects
  Lab/Experiments
  Contribution
  Awards
  Art/Sketches
  Thoughts
  Contact
Links
  Sitemap
  Legal Notice
  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| © 2026 All rights reserved.