Skip to content

Instantly share code, notes, and snippets.

View ecoad's full-sized avatar

Elliot Coad ecoad

View GitHub Profile
var _ = require('lodash')
module.exports = function (actual, expected, ignoreObjectLength, ignoreFunctions) {
/* jshint maxcomplexity: 7 */
if (arguments.length < 2) {
throw new Error('Not enough arguments')
}
@aws-scripting-guy
aws-scripting-guy / get_account_id_lambda.py
Created March 6, 2016 23:49
Get AWS account id inside Lambda function programmatically - python
def lambda_handler(event, context):
# Get Account Id from lambda function arn
print "lambda arn: " + context.invoked_function_arn
# Get Account ID from lambda function arn in the context
ACCOUNT_ID = context.invoked_function_arn.split(":")[4]
print "Account ID=" + ACCOUNT_ID