Skip to content

Instantly share code, notes, and snippets.

View avishayil's full-sized avatar

Avishay Bar avishayil

View GitHub Profile
@avishayil
avishayil / eb-from-bitbucket-pipelines.json
Last active January 19, 2018 00:42
Policy for bitbucket IAM user to EB
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"cloudformation:GetTemplate",
@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';