From f942e38e4c00d193c164905c9cc954c3b44d3294 Mon Sep 17 00:00:00 2001 From: Andy Miles Date: Wed, 6 Nov 2024 09:37:02 -0800 Subject: [PATCH] use shorter sleep time - now 2 mins --- terraform/main.tf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/terraform/main.tf b/terraform/main.tf index 7a27152..20976fe 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -6,6 +6,29 @@ resource "aws_instance" "example" { ami = "ami-0709112b97e5accb1" instance_type = "t2.micro" + user_data = <<-EOF + #!/bin/bash + yum update -y + yum install -y python3 git + + # Clone your git repository (ensure it's public or handle git authentication accordingly) + #cd /home/ec2-user + #git clone https://github.com/your_username/your_repository.git + + # Navigate to the repository + #cd your_repository + + # Optionally, create a virtual environment + #python3 -m venv venv + #source venv/bin/activate + + # Install any required dependencies from requirements.txt + #pip install -r requirements.txt + + # Run your Python script + python3 -V + EOF + tags = { Name = "GitHubActionsEC2" }