Skip to content
[In progress] Github API/OAuth through AWS Lambda
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status GitHub issues GitHub last commit


Setup process

Local development

Invoking function locally using a local sample payload

sam local invoke --no-event OauthGithubAuthorizeFunction --parameter-overrides ParameterKey=GithubClientId,ParameterValue=foobar

Invoking function locally through local API Gateway

sam local start-api --parameter-overrides 'ParameterKey=GithubClientId,ParameterValue=XXXXXXX ParameterKey=GithubClientSecret,ParameterValue=XXXXXXX ParameterKey=GithubOatuhCallbackUrl,ParameterValue='

If the previous command ran successfully you should now be able to hit the following local endpoint to invoke your function http://localhost:3000/$FunctionPath

Packaging and deployment

Create S3 bucket:

aws s3 mb s3://BUCKET_NAME

Package Lambda (uploads to S3):

sam package \
    --output-template-file packaged.yaml \
    --s3-bucket BUCKET_NAME

Create Cloudformation Stack and deploy your SAM resources.

sam deploy \
    --template-file packaged.yaml \
    --stack-name github-activity-server \
    --capabilities CAPABILITY_IAM

After deployment is complete you can run the following command to retrieve the API Gateway Endpoint URL:

aws cloudformation describe-stacks \
    --stack-name github-activity-server \
    --query 'Stacks[].Outputs[?OutputKey==`ApiUrl`]' \
    --output table

Fetch, tail, and filter Lambda function logs

NOTE: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.

sam logs -n OauthGithubAuthorizeFunction --stack-name github-activity-server --tail


In order to delete our Serverless Application recently deployed you can use the following AWS CLI Command:

aws cloudformation delete-stack --stack-name github-activity-server
You can’t perform that action at this time.