1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
What you experienced is actually normal behavior for Amazon Lightsail instances, but there's a solution to prevent this from happening in the future.
By default, Lightsail instances are assigned a dynamic public IPv4 address. This address can change when you stop and start your instance (not just reboot). It's important to note that a reboot (restart) is different from a stop-start operation and doesn't cause the IP address to change.
In your case, when you stopped and then started your instance, it was assigned a new public IP address. This is expected behavior for instances without a static IP address.
To prevent this from happening and to maintain a consistent IP address for your instance, you should create and attach a static IP address to your Lightsail instance. A static IP address remains the same even when you stop and start your instance, which is crucial for maintaining consistent DNS records and ensuring uninterrupted access to your services.
Creating a static IP in Lightsail is straightforward and doesn't incur additional costs as long as it's attached to an instance. You can create one through the Lightsail console and attach it to your instance. Once attached, this IP address will remain constant, solving the issue you encountered.
For your use case, where you need to maintain consistent DNS records, using a static IP is highly recommended. This way, you won't have to update your DNS settings every time you stop and start your instance.
Sources
Lightsail and IPv4 address costs | AWS re:Post
View and manage IP addresses for Lightsail resources - Amazon Lightsail
Create and attach a static IP to your Lightsail instance - Amazon Lightsail
Static IP addresses in Lightsail - Amazon Lightsail

After you create the static IP address, how do you get the instance to start using it