🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

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.


Get Started Now!

Example Terraform Code for AWS provider, resources aws_key_pair

This command would generate a public and private key
$ ssh-keygen -f terraform_ec2_key

This resources would import aws key pair

### Option 1 - Terraform can generate SSL/SSH private keys using the tls_private_key resource
variable "key_name" {}
resource "tls_private_key" "example" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "generated_key" {
key_name = "var.key_name"
public_key = "${tls_private_key.example.public_key_openssh}"
}
resource "aws_instance" "web" {
ami = "ami-5b673c34"
instance_type = "t2.micro"
key_name = "${aws_key_pair.generated_key.key_name}"
tags = {
Name = "HelloWorld"
}
}
### Option 2 - Retrieving the Public Key for Your Key Pair on Linux and use with aws_key_pair using
chmod 400 my-key-pair.pem
ssh-keygen -y -f /path_to_key_pair/my-key-pair.pem >> terraform_ec2_key.pub
provider "aws" {
region = "ap-south-1"
access_key = ""
secret_key = ""
}
resource "aws_key_pair" "terraform-demo" {
key_name = "terraform-demo"
public_key = "file(terraform_ec2_key.pub)"
}

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.