> ## Content Index
> Fetch the complete content index at: https://www.techielass.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Install Terraform in the AWS CloudShell
- URL: https://www.techielass.com/install-terraform-in-the-aws-cloudshell/
- Published: 2023-01-19T08:01:01.000Z
- Updated: 2023-01-19T08:01:00.000Z
- Description: A step by step guide on how to install Terraform within the AWS CloudShell.
- Author: Sarah Lean
- Tags: Terraform, AWS

The [AWS CloudShell](https://docs.aws.amazon.com/cloudshell/latest/userguide/working-with-cloudshell.html?ref=techielass.com) is a browser-based shell that makes it quick and easy for you to securely manage, explore and interact with your AWS resources. 

CloudShell is pre-authenticated with your console credentials, so there is no need to login again. 

Tools such as AWS CLI, Python, Node.js, npm, Git and BASH utilities are pre-installed for ease of use. 

Unfortunately [Terraform](https://www.techielass.com/introduction-to-terraform/) isn’t installed, however, in this article I am going to walk you through the process of installing it within AWS CloudShell. 

## Install Terraform in AWS CloudShell

- Head over to the [AWS Management Console](https://aws.amazon.com/console/?ref=techielass.com)
- Click on the AWS CloudShell icon on the console navigation bar

![AWS Management Console](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2023/01/aws-cloudshell.png)

AWS Management Console

- We’re going to use the Terraform Version Manager to help install Terraform
- With the AWS CloudShell type in:

```bash
git clone https://github.com/tfutils/tfenv.git ~/.tfenv

```

![Cloning the Terraform Version Manager](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2023/01/git-clone-tfenv.png)

Cloning the Terraform Version Manager

- Next we want to make a new directory called *\~/bin*, to do that issue the command:

```bash
mkdir ~/bin

```

- Now we’re going to make a symlink for tfenv/bin/\* scripts into the path \~/bin by typing the command:

```bash
ln -s ~/.tfenv/bin/* ~/bin/

```

![AWS CloudShell configure Terraform install](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2023/01/aws-directory.png)

AWS CloudShell configure Terraform install

- With the Terraform Version Manager installed, we can now install Terraform. Type in the command:

```bash
tfenv install

```

![Use Terraform Version Manager to install Terraform](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2023/01/tfenv-install.png)

Use Terraform Version Manager to install Terraform

This will install the latest version of Terraform for you. You can specify a specific version if required when using the *tfenv install* command. 

If you wish to use the latest version of Terraform as default you can use the command: 

```bash
tfenv use 1.3.7

```

*It’s worth noting that this only installs Terraform within the AWS CloudShell region that you are working within.* If you use multiple AWS regions then you will need to follow the above steps each time. 

A copy of all the steps are all encapsulated within a script [here](https://gist.github.com/weeyin83/d93e4df3c58e4a8aa4dfbf1bf99425ab?ref=techielass.com). 

You can now work with Terraform within the AWS CloudShell console.