Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but wonβt spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Write a comparison between Ansible Vs Docker Vs Terraform
Terraform Ansible D
Tool category | Orchestration | Configuration management |
Approach | Immutable infrastructure | Mutable infrastructure |
Language | Declarative | Imperative |
Provisioning | Specializes in infrastructure provisioning | Limited support for infrastructure provisioning |
LIfecycle management | Lifecycle aware. Maintains state of deployments. | No lifecycle awareness |
Command line operation | Yes | Yes |
Agentless | Yes | Yes |
Docker
Tool category Storage/Volume Management ,Orchestration and Schedulers
Approach Mutable infrastructure
Language Declarative
Provisioning Specializes in infrastructure provisioning
LIfecycle management created, running, deleted, paused ,stopped
Command line operation Yes
Agentless Yes
ββββββββββββββββββββββββββββββββββββββββββββββββ-
Write a terraform script where you create a linux ec2 instance with Security group and key defined so you should be able to use key to login to ec2 instance.
terraform{
Required_Providers {
linux ec2 instance ={
source = βhashicorp/linux ec2β version = β~>3.27 β
}
}
provider βlinuxβ {
profile = βAbhishekβ
region = βus-west-2β
access_key = β β secret_key = β β
}
resource βlinux_security_group β allow key to loginβ{
name = βdevopsschoolβ
description = β allow key to login ec2 instanceβ
}