Terraform Code 추가
This commit is contained in:
15
tf/ssh_key.tf
Normal file
15
tf/ssh_key.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
resource "tls_private_key" "aws_default_key" {
|
||||
algorithm = "RSA"
|
||||
rsa_bits = 4096
|
||||
}
|
||||
|
||||
resource "aws_key_pair" "aws_default_key_pair" {
|
||||
key_name = "junghun-key"
|
||||
public_key = tls_private_key.aws_default_key.public_key_openssh
|
||||
}
|
||||
|
||||
resource "local_file" "private_key" {
|
||||
filename = "${path.module}/aws_private_key.pem"
|
||||
content = tls_private_key.aws_default_key.private_key_pem
|
||||
file_permission = "0400"
|
||||
}
|
||||
Reference in New Issue
Block a user