terraform script and some differences b/w docker,ansible

comparison between Ansible Vs Docker Vs Terraform::

what is Ansible? Ansible is an open-source automation engine that helps in DevOps and comes to the rescue to improve your technological environment’s scalability, consistency, and reliability. It is mainly used for rigorous IT tasks such as configuration management, application deployment, intraservice orchestration, and provisioning

What is Docker? Enterprise Container Platform for High-Velocity Innovation. The Docker Platform is the industry-leading container platform for continuous, high-velocity innovation, enabling organizations to seamlessly build and share any application — from legacy to what comes next — and securely run them anywhere.

What is Terraform? Describe your complete infrastructure as code and build resources across providers. With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.

Terraform script using group and key::

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
	
  }
}

# Configure the AWS Provider
provider "aws" {
  region     = "us-west-2"
  access_key = "XXXXXXXXXXXXXXX"
  secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXX"
}

#aws resources
resource "aws_instance" "linux_instance" {
  ami           = "ami-0dc8f589abe99f538" # linux ami in aws
  instance_type = "t2.micro"
  
  tags = {
    Name = "linux_instance"
  }
}