Home:ALL Converter>AWS Lambda function to start/stop Aurora Cluster

AWS Lambda function to start/stop Aurora Cluster

Ask Time:2021-06-08T13:36:51         Author:Farooq Butt

Json Formatter

I am running an staging Aurora Cluster on AWS consisting of 1 writer and 1 reader with Engine version: 5.7.mysql_aurora.2.07.2.

Is there a way to schedule start/stop of aurora cluster via lambda ? The idea here is to save cost. I was able to schedule start/stop of my EC2 instance with lambda and cloudwatch rules with a cron expression. But i cannot find anything similar for my aurora cluster.

Author:Farooq Butt,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67881956/aws-lambda-function-to-start-stop-aurora-cluster
Gunjan :

This option is available:\nStarting the cluster and Stopping the cluster\nYou can write lambda function like this:\nimport boto3\n\nclient = boto3.client('rds')\n\naurora_db_cluster = 'your-db-cluster-identifier'\nresponse = client.stop_db_cluster(\n DBClusterIdentifier=aurora_db_cluster\n)\n\nresponse = client.stop_db_cluster(\n DBClusterIdentifier=aurora_db_cluster\n)\n\nMake sure lambda function has IAM rights to perform this action.",
2021-06-08T05:58:26
yy