The following script rds_update.sh updates the configuration. It requires the name of the target DB parameter group and the path of the temporary folder containing the generated configuration:
#!/bin/bash
set -euo pipefail
GROUP_NAME=$1
TMPFLD=$2
TS=`date +'%y%m%d%H%M%S'`
cd ${TMPFLD}
cp oraconf conf.$TS
AWK_CODE='{n=$2} $2~/[0-9]+m$/ {gsub(/m$/,"",n);n=n*1024*1024} $2~/[0-9]+k$/ {gsub(/k$/,"",n);n=n*1024} {print "ParameterName="$1",ParameterValue="n",ApplyMethod=pending-reboot"}'
echo Applying params: ; awk "${AWK_CODE}" oraconf
aws rds modify-db-parameter-group \
--db-parameter-group-name ${GROUP_NAME} \
--parameters `awk "${AWK_CODE}" oraconf`
# dump full new conf
aws rds describe-db-parameters \
--db-parameter-group-name ${GROUP_NAME} | jq -c '.Parameters[] | {ParameterName, ParameterValue}' > full_pars_dump.$TS.jsonl
# if configuration changed wrt last one (ie: this is the first trial of the new experiment) wait for update propagation
diff -q `ls conf\.* | tail -n2` || (echo 'Configuration changed. Waiting for propagation.' && sleep 420 )
The following script rds_reboot.sh restarts the RDS instance with the provided ID: