Skip to content

Commit

Permalink
Create sanitech_performance_testing.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Apr 19, 2024
1 parent 35eeb76 commit 01625d7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions func/sanitech_performance_testing.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "aws_instance" "performance_testing" {
ami = "ami-0c94855ba95c574c8"
instance_type = "t2.micro"

tags = {
Name = "performance-testing"
}
}

resource "null_resource" "performance_testing" {
provisioner "remote-exec" {
inline = [
"sudo apt-get update",
"sudo apt-get install -y apache2",
"sudo systemctl start apache2",
"siege -c100 -t30S http://${aws_instance.performance_testing.public_ip}"
]

connection {
type = "ssh"
user = "ubuntu"
host = aws_instance.performance_testing.public_ip
private_key = file("~/.ssh/id_rsa")
}
}
}

0 comments on commit 01625d7

Please sign in to comment.