Configuring AWS with terraform using Ubuntu
Tags: aws, beginners, terraform, github
Published: 2022-01-20 19:51:37

_Hello there 🙋‍♀️_

I will be sharing the basic steps on how to configure AWS with terraform using Ubuntu. If you're a beginner, this will definitely save you some time and energy.

**Here we go... Yayyy**

Hey...**You need to have an AWS account** you might want to try the free access account as a beginner.

You need to download your **_VMware workstation pro_** (**Make sure it is the latest version of Ubuntu**). It is quite heavy and takes a very long time to download and install this. 

Make sure to remember your Credentials (Username and Password) while installing your VMware. Note, this is very important

_You should get this after installation_

**It starts from here;**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73l9v90oggp5ah9xndo9.PNG)



**and ends here...**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2v0qe3nvkz64945ijyx.PNG)


If you follow this steps clearly, you should get **terraform installed on your VMware workstation pro**. Here are the steps in order;

On your platform, search for **_terminal_** then click on it to get started. Now run the following commands;

**1. wget https://releases.hashicorp.com/terraform/1.1.3/terraform_1.1.3_linux_amd64.zip (always confirm the latest version)**

**2. sudo apt-get install zip -y** (Sudo means superuser do or substitute user do)

**3. unzip terraform*.zip**

**4.sudo mv terraform /usr/local/bin**

**5. terraform --version**  or **terraform -v** (this will give you the version of terraform you installed)

**6. mkdir  /terraform** (this has to do with directory)

**7. cd /terraform**

**8. vim config.tf**

You should get this after running those commands;


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fixlx45tyipr9lrh5em.jpg)


**_If you have gotten this far...Kudos_**

**9. You have to fill this in for configuration**

**provider "aws" {
  project     = "my-project-id"
  region      = "us-central1"
}**

_You can leave the page by clicking on (esc ,then shift and : then type wq) with this you can leave the page, so as to go back to continue with deployment._

**10. Now run terraform innit**

**Now log in to the AWS Management Console** click on your name on the dashboard, scroll down to security credentials. Copy the Access keys(access key ID and secret access key)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ciuxxl26matme7nreog.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0aaqmfp9it8ywv23gaf.PNG)

**11. sudo snap install aws-cli --classic**

**12. aws configure**

_fill all the required credentials here_ (credentials from step 10)

**13. mkdir  /terraform**

**14. cd /terraform**

**15. touch main.tf**

**_Make sure to fill in this command, it should appear like 
this_**

  **terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.27"**
    }
  }
  required_version = ">= 0.14.9"
}

**provider "aws" {
  profile = "default"
  region  = "us-west-2"**
}
 **resource "s3 bucket" "tolubucket" {
  bucket         = "clouddeveloper"
  acl =  private**
  tags = {
    Name = "storage bucket"
  }
}

**16. Now run terraform innit**

**17. terraform plan**

**18. terraform apply**

**Now go to your AWS Console to check your deployment**

_That is all!_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhjagrjbd25dakd2xo9t.jpg)

**_well done...  If you have gotten this far, Kudos_**.

**_See you on my next blog_👊** **_There is a section 2 for this_**