Why can’t an AWS lambda function inside a public subnet in a VPC connect to the internet?

Lambda functions connected to a VPC public subnet cannot typically access the internet. To access the internet from a public subnet you need a public IP or you need to route via a NAT that itself has a public IP. You also need an Internet Gateway (IGW). However: Lambda functions do not, and cannot, have … Read more

Connect to Amazon EC2 file directory using Filezilla and SFTP

I’ve created a video tutorial for this. Just check: Connect to Amazon EC2 file directory using FileZilla and SFTP, Video Tutorial Summary of above video tutorial: Edit (Preferences) > Settings > Connection > SFTP, Click “Add key file” Browse to the location of your .pem file and select it. A message box will appear asking … Read more

How to submit Spark jobs to EMR cluster from Airflow?

While it may not directly address your particular query, broadly, here are some ways you can trigger spark-submit on (remote) EMR via Airflow Use Apache Livy This solution is actually independent of remote server, i.e., EMR Here’s an example The downside is that Livy is in early stages and its API appears incomplete and wonky … Read more

Permission denied (publickey) when SSH Access to Amazon EC2 instance [closed]

This error message means you failed to authenticate. These are common reasons that can cause that: Trying to connect with the wrong key. Are you sure this instance is using this keypair? Trying to connect with the wrong username. ubuntu is the username for the ubuntu based AWS distribution, but on some others it’s ec2-user … Read more

Is there a way to change the http status codes returned by Amazon API Gateway?

Update per 20-9-2016 Amazon finally made this easy using the Lambda Proxy integration. This allows your Lambda function to return proper HTTP codes and headers: let response = { statusCode: ‘400’, body: JSON.stringify({ error: ‘you messed up!’ }), headers: { ‘Content-Type’: ‘application/json’, } }; context.succeed(response); Say goodbye request/response mapping in the API Gateway! Option 2 … Read more

How to add SSL certificate to AWS EC2 with the help of new AWS Certificate Manager service

Q: Can I use certificates on Amazon EC2 instances or on my own servers? No. At this time, certificates provided by ACM can only be used with specific AWS services. Q: With which AWS services can I use certificates provided by ACM? You can use ACM with the following AWS services: • Elastic Load Balancing … Read more

Make a bucket public in Amazon S3

You can set a bucket policy as detailed in this blog post: http://ariejan.net/2010/12/24/public-readable-amazon-s3-bucket-policy/ As per @robbyt’s suggestion, create a bucket policy with the following JSON: { “Version”: “2008-10-17”, “Statement”: [ { “Sid”: “AllowPublicRead”, “Effect”: “Allow”, “Principal”: { “AWS”: “*” }, “Action”: [ “s3:GetObject” ], “Resource”: [ “arn:aws:s3:::bucket/*” ] } ] } Important: replace bucket in … Read more