Skip to content

Instantly share code, notes, and snippets.

@sapessi
sapessi / gist:11a87ed83954461d5e43
Created February 18, 2016 22:29
Specify an API Gateway authorizer using a Lambda qualifier
# First we update the authorizer to call the right lambda function including the qualifier :xxx at the end of the function ARN
aws apigateway update-authorizer --rest-api-id XXXXXXXXX --authorizer-id XXXXX --patch-operations op=replace,path=/authorizerUri,value=arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:XXXXXXXXXXX:function:Authorize2:AliasOrVersion/invocations
# Then we give API Gateway permission to invoke the authorizer using resource policies on the Lambda function
aws lambda add-permission --function-name Authorize2 --statement-id mystatement12334 --action lambda:InvokeFunction --principal apigateway.amazonaws.com --qualifier AliasOrVersion --source-arn arn:aws:execute-api:us-west-2:XXXXXXXXXXX:XXApiIdXX/authorizers/XXAuthorizerIdXX
# You can check the structure of your authorizer with
aws apigateway get-authorizer --rest-api-id XXXXXX --authorizer-id XXXX
# You can also check the policy against the lambda function with
@mikepea
mikepea / pr_etiquette.md
Last active April 14, 2024 14:29
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@mikermcneil
mikermcneil / Node.js installation on Rackspace
Created January 13, 2012 13:25
Installing nodejs, npm, and all their pals on a Rackspace Ubuntu 11.10 Server
############################################################################
# Installing nodejs, npm, and all their pals on a Rackspace Ubuntu Server
############################################################################
# First get your tools together
apt-get update
apt-get install emacs
apt-get install git
apt-get install curl
apt-get install libssl-dev