Posts

Showing posts from February, 2018

Deploying AWS Lambdas with an NPM script or bash

Requires: AWS CLI ( https://aws.amazon.com/cli ) installed and working. Update December 2020 : use this bash script instead. This the best version of the script so far.  Updates / improvements welcome. You can get the ARN from the AWS website or you can run this code:   aws lambda get-function --function-name <functionNameGoesHere> | grep FunctionArn Then edit your package.json such that the "scripts" portion looks like this (append to, don't overwrite, existing keys):   "scripts": {     "deploy": "aws lambda update-function-code --function-name arn:some-crazy-numbers:function:hello-world --zip-file fileb://lambdaDeployment.zip",     "predeploy": "rm -f lambdaDeployment.zip; zip -r lambdaDeployment.zip * -x *.git* *.zip package*.json *.log '*node_modules*' '*.DS_Store' '*spec/*'"   }, OR, if you have all of your files in a 'src' directory, use these:   "scripts&qu

Deleting empty AWS Elastic Beanstalk S3 buckets

Read from https://forums.aws.amazon.com/thread.jspa?threadID=145366 [empty the bucket] Go to the bucket's policy (bucket --> properties --> permissions --> edit bucket policy) Then find this statement { "Sid": xxxxxxxxx, "Effect": "Deny", "Principal": { "AWS": "*" }, "Action": "s3:DeleteBucket", "Resource": xxxxxxxxxx } Change the Effect from Deny to Allow. Save the change to the Bucket Policy. Now right click on the bucket and press delete.