Cyber Deals - Get up to 65% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

Terraform Cheatsheet

Terraform Cheatsheet

Find the downstream version of this cheat sheet here

About Terraform CLI

Terraform, a tool created by Hashicorp in 2014, written in Go, aims to build, change and version control your infrastructure. This tool have a powerfull and very intuitive Command Line Interface.

Installation

Install through curl

$ curl -O https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip
$ sudo unzip terraform_0.11.10_linux_amd64.zip -d /usr/local/bin/
$ rm terraform_0.11.10_linux_amd64.zip

## OR install through tfenv: a Terraform version manager
## First of all, download the tfenv binary and put it in your PATH.
$ git clone https://github.com/Zordrak/tfenv.git ~/.tfenv
$ echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> $HOME/bashrc

##Then, you can install desired version of terraform:
$ tfenv install 0.11.10
Usage
Show version
$ terraform --version
Terraform v0.11.10
Init Terraform
$ terraform init
It’s the
State
Pull remote state in a local copy
$ terraform state pull > terraform.tfstate
Push state in remote backend storage
$ terraform state push
This command is usefull if for example you riginally use a local tf
state and then you de
Disclaimer: Views expressed in articles are those of the respective authors and do not necessarily reflect the views of their employers or this site. While we aim for accuracy, please verify information before relying on it, and let us know if you spot an error.
Share:

Related Posts

GitLab Notes

GitLab Notes

Install GitLab Runner (Binary) Reference # Download binary sudo curl -L --output /usr/local/bin/gitlab-runner …

Ansible LightSpeed

Ansible LightSpeed

Introduction Ansible Lightspeed is a generative AI service designed to streamline the creation and maintenance of Ansible Playbooks. Here’s a …

Awesome DevSecSysOps Tools on Internet

Awesome DevSecSysOps Tools on Internet

This is a page where I keep all those list of tools on internet, which we use for our day-to-day tasks.

Ansible Tower - Load Balancing

Ansible Tower - Load Balancing

1. Ansible Tower Installation 1. Ansible Tower Installation 1.1. Ansible Tower Installation and Reference Guide v3.6.1 1.2. Ansible Tower Quick …

AWS CLI Cheatsheet

AWS CLI Cheatsheet

The AWS Command Line Interface (CLI) is a powerful tool that provides a streamlined way to interact with Amazon Web Services (AWS) directly from your …

Cheat sheets

Docker Cheat Sheet

This page has moved. See the combined Docker & Podman Cheatsheet, which includes Docker and Podman commands side by side.