Hi@akhtar,
You can use the aws_instance resource in Terraform. This helps us to launch an instance in AWS. But before that, you need the details of AMI ID, type, etc. You can take help from the below-given code.
resource "aws_instance" "mysql" {
ami = "ami-0019ac6129392a0f2"
instance_type = "t2.micro"
subnet_id = aws_subnet.private.id
vpc_security_group_ids = [aws_security_group.mywebsecurity.id]
key_name = "mynewkey"
availability_zone = "ap-south-1b"
tags = {
Name = "mysql"
}
}