Skip to content

Instantly share code, notes, and snippets.

View madhoshyagnik's full-sized avatar

Madhosh Yagnik madhoshyagnik

View GitHub Profile
@madhoshyagnik
madhoshyagnik / index.js
Created October 9, 2024 10:27 — forked from avishayil/index.js
Lambda function for promoting replica to master
var AWS = require('aws-sdk');
AWS.config.update({ region: 'your-region-ie:eu-central-1' });
var mysql = require('mysql');
// Better to use environment variables, but for the example we'll leave it like this
var dbClusterIdentifier = 'your-cluster';
var clusterEndpoint = 'your-cluster.cluster-identifier.your-region.rds.amazonaws.com';
var user = 'username';
var password = 'password';