Getting started with Terraform and AWS on Debian

Install Terraform on Debian - you can follow the official documentation too:

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install terraform
Authenticate to AWS
Create a terraform user in IAM with Programmatic accesss and attach to it AdministratorAccess policy. Save somewhere Access Key ID and Secret Access Key.
Install awscli:
sudo pip install awscli
Configure it:
aws configure
and enter saved Access Key ID and Secret Access Key
Create a basic Terraform configuration - main.tf:
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "example" {
  ami           = "ami-011899242bb902164" # Ubuntu 20.04 LTS
  instance_type = "t3.nano"
}
Initialize the backend:
terraform init
Plan. See the changes to be applied as output:
terraform plan
Apply the changes:
terraform apply
you can now go the the AWS console to see the new-created instance details.
Destroy the created instance:
terraform destroy