add user_data templatefile and add SSH_PUBLIC_KEY to trusted keys
This commit is contained in:
parent
119a8f3289
commit
5b5250badc
5
main.tf
5
main.tf
|
@ -151,5 +151,8 @@ resource "aws_instance" "ubuntu_instance" {
|
|||
delete_on_termination = true
|
||||
}
|
||||
|
||||
user_data = var.user_data
|
||||
# Use templatefile for user_data: https://developer.hashicorp.com/terraform/language/v1.2.x/functions/templatefile
|
||||
user_data = templatefile("${path.module}/user_data.sh", {
|
||||
extra_key = var.SSH_PUBLIC_KEY
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue