AWS EC2 instance lifecycle status and impact on billing
- Refer Here for official docs
AWS EC2 instance
- Lets create an ec2 instance with ubuntu 22.04
- While creating the ec2 ensure the security group has 80 port opened and you select any key pair
- Login into ec2 instance and then install nginx
sudo apt update
sudo apt install nginx -y
-
Navigate
http://<public-ip>
from browser
- Doing the same steps by using user data.
- User data in AWS can run a script once when you are creating a new ec2 instance
- when userdata is not working refer to
/var/log/cloud-init*.log
- Rebooting the AWS instances will not change the public ip, stop and start will change the public ip.