API Gateway – POST multipart/form-data

API Gateway does not currently support multipart form data. This is being considered for future development. In the meantime, you will need to modify your client to use multiple requests or a single one-part request. Update: API Gateway now supports binary payloads. Simply define multipart/form-data as a binary media type for your API and proxy … Read more

How do you pass custom environment variable on Amazon Elastic Beanstalk (AWS EBS)?

As a heads up to anyone who uses the .ebextensions/*.config way: nowadays you can add, edit and remove environment variables in the Elastic Beanstalk web interface. The variables are under Configuration → Software Configuration: Creating the vars in .ebextensions like in Onema’s answer still works. It can even be preferable, e.g. if you will deploy … Read more

AWS Elastic Beanstalk, running a cronjob

This is how I added a cron job to Elastic Beanstalk: Create a folder at the root of your application called .ebextensions if it doesn’t exist already. Then create a config file inside the .ebextensions folder. I’ll use example.config for illustration purposes. Then add this to example.config container_commands: 01_some_cron_job: command: “cat .ebextensions/some_cron_job.txt > /etc/cron.d/some_cron_job && … Read more

CloudFront + S3 Website: “The specified key does not exist” when an implicit index document should be displayed

I’ll go out on a limb and say that the specified key doesn’t technically exist, so the error message is technically accurate but doesn’t tell the whole story. This should be an easy fix. S3 buckets have two¹ endpoints, “REST” and “website.” They have two different feature sets. The web site endpoint provides magical resolution … Read more

Can an AWS Lambda function call another

I found a way using the aws-sdk. var aws = require(‘aws-sdk’); var lambda = new aws.Lambda({ region: ‘us-west-2’ //change to your region }); lambda.invoke({ FunctionName: ‘name_of_your_lambda_function’, Payload: JSON.stringify(event, null, 2) // pass params }, function(error, data) { if (error) { context.done(‘error’, error); } if(data.Payload){ context.succeed(data.Payload) } }); You can find the doc here: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html

How to get the instance id from within an ec2 instance?

See the EC2 documentation on the subject. Run: wget -q -O – http://169.254.169.254/latest/meta-data/instance-id If you need programmatic access to the instance ID from within a script, die() { status=$1; shift; echo “FATAL: $*”; exit $status; } EC2_INSTANCE_ID=”`wget -q -O – http://169.254.169.254/latest/meta-data/instance-id || die \”wget instance-id has failed: $?\”`” Here is an example of a more … Read more