Recently I was playing around a bit with AWS as a part of a course that I am doing. I came across a situation that to be honest is keeping be in vilo.
I made a web application which connects to a backend that basically launches a EC2 t2.micro instance on AWS. From time to time, I pull the status of the machine to check whether it is on
running state or note. The AMI I am using it is a configured wordpress from the marketplace.
As soon as the instance gets to the
running state, I show a message indicating the server is up and running and provide the user with the instance's public ip address, the problem is that, it is not after a few minutes later when indeed the IP is resolved/accessible. The security group attached to the instance has the inbound and outbound traffic configured to allow TCP traffic on port 80, 22 and 443.
My question is, the
running state simply means the instance is ready to work but, as far as I know, it does not mean OS has booted nor the X application (in this case wordpress and its configured server) are ready to or finished the bootstrapping. How can I check that indeed the application/OS has booted is I can ensure that when the user is trying to access the IP it will not timeout.
My first attempt was to ping the instance bu to be honest I don't think it's a reliable request since, I'd also need to enable the ICMP protocol but at the end, it's working in another internet layer.