Assigning existing Security Group and Key Pair

Hi everyone this might be an easy question but I’m struggling to do this:

I am looking to launch an ec2 instance in aws that uses existing Security Group and Keypair.
Any help or can point me to any documentation. Thank you!

resource "aws_security_group" "default" {
}

resource "aws_key_pair" "default"{
  public_key = file(var.PATH_TO_PUBLIC_KEY)
}