Skip to content

Instantly share code, notes, and snippets.

View madhoshyagnik's full-sized avatar

Madhosh Yagnik madhoshyagnik

View GitHub Profile
@avishayil
avishayil / index.js
Created December 13, 2017 09:16
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';