I am working on task 1 of terraform, but facing issue when submitting. All things seems to be correct and done using terraform only but it is giving error as:
I have attached the solution.
resource "tls_private_key" "rsa_key"{
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "aws_key" {
key_name = "datacenter-kp"
public_key = tls_private_key.rsa_key.public_key_openssh
}
resource "local_file" "key_local" {
content = tls_private_key.rsa_key.private_key_pem
filename = "/home/bob/datacenter-kp.pem"
}
What can be the issue here…