diff --git a/ec2.tf b/ec2.tf index 37d57eb..a618758 100644 --- a/ec2.tf +++ b/ec2.tf @@ -14,14 +14,21 @@ resource "aws_instance" "k3s_box" { # user_data = "${file("./setup_scripts/script.sh")}" + connection { + type = "ssh" + user = "ec2-user" + private_key = file("${local_file.k3s_box_private_key.filename}") + host = self.public_ip + } + provisioner "file" { source = "./setup_scripts/install_crontab.sh" - destination = "/home/ec2-user" + destination = "/home/ec2-user/install_crontab.sh" } provisioner "file" { source = "./setup_scripts/duckdns.sh" - destination = "/home/ec2-user" + destination = "/home/ec2-user/duckdns.sh" } provisioner "remote-exec" {