Is it possible to automatic enable/disable container service or start/stop database in Amazon Lightsail?

0

I'm currently using AWS Lightsail. My main resources are a container service and a relational database (mysql). I would like to know if is possible to schedule an action to enable/disable the container service or start/stop the database, using lambda or some other option.

Natale
demandé il y a 9 mois288 vues
1 réponse
0

Hello.
You can use "stop_relational_database" to stop the Lightsail database.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lightsail/client/stop_relational_database.html

For Lightsail containers, it is possible to disable the service using "update_container_service".
Note, however, that Lightsail containers are still charged even if disabled.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lightsail/client/update_container_service.html

https://aws.amazon.com/lightsail/faq/?nc1=h_ls#Containers

Q: Will I be charged for the whole month even if I run my container service for a few days?

Your Lightsail container services are charged only when they're in the running or disabled state. If you delete your Lightsail container service before the end of the month, we charge you a prorated cost based on the total number of hours that you used your Lightsail container service. For example, if you use your Lightsail container service with a power of Micro and scale of 1 for 100 hours in a month, you will be charged $1.34 ($0.0134*100).

profile picture
EXPERT
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions