Amazon RDS - Online only when needed

0 votes

I had a question about Amazon RDS. I only need the database online for about 2 hours a day but I am dealing with quite a large database at around 1gb.

I have two main questions:

  1. Can I automate bringing my RDS database online and offline via scripts to save money?

  2. When I put a RDS offline to stop the "work hours" counter running and billing me, when I bring it back online will it still have the same content (i.e will all my data stay there, or will it have to be a blank DB?). If so, is there any way around this rather than backing up to S3 and reimporting it every time?

Mar 14, 2022 in Others by Edureka
• 13,670 points
390 views

1 answer to this question.

0 votes

Here's a script that will stop/start/reboot an RDS instance

#!/bin/bash

# usage ./startStop.sh lhdevices start

INSTANCE="$1"
ACTION="$2"



# export vars to run RDS CLI
export JAVA_HOME=/usr;
export AWS_RDS_HOME=/home/mysql/RDSCli-1.15.001;
export PATH=$PATH:/home/mysql/RDSCli-1.15.001/bin;
export EC2_REGION=us-east-1;
export AWS_CREDENTIAL_FILE=/home/mysql/RDSCli-1.15.001/keysLightaria.txt;

if [ $# -ne 2 ]
then
echo "Usage: $0 {MySQL-Instance Name} {Action either start, stop or reboot}"
echo ""
exit 1
fi


shopt -s nocasematch

if [[ $ACTION == 'start' ]]
then
echo "This will $ACTION a MySQL Instance"  
rds-restore-db-instance-from-db-snapshot lhdevices 
--db-snapshot-identifier        dbStart --availability-zone us-east-1a     
--db-instance-class db.m1.small 

echo "Sleeping while instance is created"
sleep 10m
answered Mar 25, 2022 by Edureka
• 13,670 points

Related Questions In Others

0 votes
1 answer

Exporting a table from Amazon RDS into a CSV file

Presumably, you're attempting to export data from ...READ MORE

answered Mar 3, 2022 in Others by gaurav
• 23,260 points
1,929 views
0 votes
1 answer

How to get password of the Amazon aws rds user?

Follow these procedures to update the master ...READ MORE

answered Mar 9, 2022 in Others by gaurav
• 23,260 points

edited Jun 20, 2023 by Khan Sarfaraz 10,906 views
0 votes
0 answers

Access Amazon RDS database in VPC from Lambda locally

Is there any way we can access ...READ MORE

Mar 9, 2022 in Others by Edureka
• 13,670 points
338 views
0 votes
0 answers

How to compare two Amazon RDS snapshots?

I took a snapshot of amazon RDS ...READ MORE

Apr 9, 2022 in Others by Kichu
• 19,050 points
318 views
0 votes
1 answer

Amazon RDS Instance Password?

If you're getting issues when using the ...READ MORE

answered Mar 3, 2022 in Others by gaurav
• 23,260 points
801 views
0 votes
1 answer

AWS RDS last connection date

To see the last 24 hours' worth ...READ MORE

answered Mar 15, 2022 in Others by gaurav
• 23,260 points
1,456 views
0 votes
1 answer

AWS RDS MSSQL logs so many failed login attempts

Observing log files When you look at a ...READ MORE

answered Mar 25, 2022 in Others by Edureka
• 13,670 points
1,333 views
0 votes
1 answer

Refresh powerbi online with SQL data base (RDS AWS)

It must connect to the database successfully ...READ MORE

answered Mar 25, 2022 in Others by Edureka
• 13,670 points
944 views
0 votes
1 answer

How to run seed.rb file on Amazon ec2

To gain access to the Amazon instance, ...READ MORE

answered Mar 24, 2022 in Others by Edureka
• 13,670 points
419 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP