add user_data templatefile and add SSH_PUBLIC_KEY to trusted keys

This commit is contained in:
Ryan Malloy 2024-11-10 04:36:51 -07:00
parent 119a8f3289
commit 5b5250badc
1 changed files with 4 additions and 1 deletions

View File

@ -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
})
}