diff --git a/IaC/aws/terraform/ec2.tf b/IaC/aws/terraform/ec2.tf index b664101..8ce6930 100644 --- a/IaC/aws/terraform/ec2.tf +++ b/IaC/aws/terraform/ec2.tf @@ -11,13 +11,30 @@ resource "aws_instance" "ec2example" { associate_public_ip_address = true key_name = aws_key_pair.ec2_key_pair.key_name +} + +resource "null_resource" "wait_for_instance" { + depends_on = [aws_instance.ec2example] + provisioner "local-exec" { - command = "ansible-playbook -i '${self.public_ip},' ${path.module}/../../ansible/apache.yml" + command = <