Skip to content

Instantly share code, notes, and snippets.


Hassan Murtaza MrHassanMurtaza

Block or report user

Report or block MrHassanMurtaza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MrHassanMurtaza /
Last active Jan 10, 2020
AWS CodePipeline Executor Python
import json, os
import boto3
from botocore.exceptions import ClientError
def lambda_handler(event, context):
Lambda Handler
Triggers AWS CodePipeline
:param event: takes event triggered by cloudwatch rule
MrHassanMurtaza / serverless-deploy-iam.json
Created Nov 21, 2019
Serverless Deploy Permissions with SQS as a Trigger
View serverless-deploy-iam.json
"Version": "2012-10-17",
"Statement": [
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
MrHassanMurtaza / secret-manager-policy.json
Last active Oct 24, 2019
Secret manager attribute based access control
View secret-manager-policy.json
"Action": "secretsmanager:GetSecretValue",
"Resource": "*",
"Condition": {
"secretsmanager:ResourceTag/Project": "${aws:PrincipalTag/Project}"
View secret-manager-to-env.js
// Use this code snippet in your app.
// If you need more information about configurations or implementing the sample code, visit the AWS docs:
// Load the AWS SDK
var AWS = require('aws-sdk'),
region = "us-west-2",
secretName = `${DEPLOYMENT_GROUP_NAME}`,
View AWSDevOpsExamTips
◾Understand autoscaling inside and out.
◾Make sure you know the differences between deploying with and without Cloudformation (as there are some deployment methods you can do with Cloudformation that you can’t without) and the command or JSON syntax to perform them.
◾Understand lifecycle hooks and the autoscaling stages they run in
◾Understand launch configurations and how they work and are updated (hint: You must replace them)
◾Understand why you may need to place an instance into STANDBY state
•Elastic Beanstalk.
◾You’ll need to know this to an advanced level.
◾Understand what stacks Beanstalk supports natively and how you would deploy a stack it doesn’t (hint: Use Docker).
MrHassanMurtaza / csv-to-json.js
Last active Aug 17, 2019
Convert CSV to JSON based on Delimeter
View csv-to-json.js
const removeSpaces = (str) => {
return str.replace(/^\s+|\s+$/g, "");
const DELIMITER = '|';
const csvJSON = (csv) => {
let lines = csv.split("\n");
MrHassanMurtaza / circleci.yml
Created Jul 24, 2019 — forked from statico/circleci.yml
Node.js 10 + PostgreSQL CircleCI config
View circleci.yml
version: 2
version: 2
- test
MrHassanMurtaza / config.yml
Created Jul 24, 2019 — forked from posva/config.yml
Simple Circle CI 2 config for node/js projects
View config.yml
# Javascript Node 8 simple CircleCI 2.0 configuration file
# Eduardo San Martin Morote
# Check for more details
# Put this file in a .circleci/ folder
version: 2
MrHassanMurtaza / lambda_rds_mysql.js
Last active Jul 9, 2019
Connect Lambda to RDS MySql
View lambda_rds_mysql.js
const mysql = require('mysql');
var config = require('./config.json');
exports.handler = function(event, context, callback) {
var pool = mysql.createPool({
host : config.dbhost,
user : config.dbuser,
password : config.dbpassword,
MrHassanMurtaza /
Last active May 27, 2019
Automate Analyzing your IAM Permissions using IAM Access Advisor
import boto3
from botocore.exceptions import ClientError
from datetime import datetime, timezone
import traceback
from time import sleep
SENDER = "John Doe <>"
You can’t perform that action at this time.