Create AWS Keypair with Terraform tool through this tutorial video to SSH in your EC2 instance. In this demo you will 2 ways to create and attach your AWS keypair using Infrastructure as a code tool TERRAFORM!
Terraform Documentation link:
Resource: aws_key_pair: https://registry.terraform.io/provide...
tls_private_key:
https://registry.terraform.io/provide...
local_file:
https://registry.terraform.io/provide...
-----------------------------------------------------------------------------------------------------------------------
#terraform code
resource "aws_instance" "web" {
ami = "ami-00ee4df451840fa9d" #Amazon Linux AMI
instance_type = "t2.micro"
security_groups = [aws_security_group.TF_SG.name]
#first method
key_name = "TF_key"
tags = {
Name = "Terraform Ec2"
}
}
#keypair second method for Key_pair
resource "aws_key_pair" "TF_key" {
key_name = "TF_key"
public_key = tls_private_key.rsa.public_key_openssh
}
resource "tls_private_key" "rsa" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "local_file" "TF-key" {
content = tls_private_key.rsa.private_key_pem
filename = "tfkey"
}
-----------------------------------------------------------------------------------------------------------------------
Learn How to create EC2 instance in Terraform : • How to create Amazon EC2 instance usi...
Create security group usingTerraform Tool: • How to Create AWS Security group usin...
Learn Ansible Tool: • Ansible 101 | Learn Ansible right now...
AWS SAA C02 Practice Test: • AWS Certified Solutions Architect Ass...
------------------------------------------------------------------------------------------------------------------
Connect with me on LinkedIn for notes : / nasiullha-chaudhari-5a80601a8
-----------------------------------------------------------------------------------------------------------------
.
infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair terraform aws key,terraform aws key_name,resource key pair,ssh key terraform,terraform ssh key,terraform ssh key ec2,ssh ec2 terraform,aws key using terraform,aws ec2 instance using terraform,aws public key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair terraform aws key,terraform aws key_name,resource key pair,ssh key terraform,terraform ssh key,terraform ssh key ec2,ssh ec2 terraform,aws key using terraform,aws ec2 instance using terraform,aws public key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair terraform aws key,terraform aws key_name,resource key pair,ssh key terraform,terraform ssh key,terraform ssh key ec2,ssh ec2 terraform,aws key using terraform,aws ec2 instance using terraform,aws public key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair terraform aws key,terraform aws key_name,resource key pair,ssh key terraform,terraform ssh key,terraform ssh key ec2,ssh ec2 terraform,aws key using terraform,aws ec2 instance using terraform,aws public key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair terraform aws key,terraform aws key_name,resource key pair,ssh key terraform,terraform ssh key,terraform ssh key ec2,ssh ec2 terraform,aws key using terraform,aws ec2 instance using terraform,aws public key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform,key pair terraform aws,key pair key,infrastructure as code,keypair terraform,aws terraform,terraform key pair ec2,terraform key pair module,aws keypair cloudformation,create keypair terraform,create ec2 keypair using terraform,aws ec2 keypair with terraform #awsec2