From e27a78867e3918eb25628fc79efbd9861e5352d9 Mon Sep 17 00:00:00 2001 From: Daniel Mikula Date: Mon, 22 May 2023 14:19:11 +0200 Subject: [PATCH] fixed provisioning with file --- ec2.tf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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" {