Notes and anecdotes

Techstuff rambling

Adding a python API handler with serverless

Create an AWS Lambda function with Python3 and integrate with S3? Simple if you know how (though getting there is a bitch, I bet Amazon does this on purpose as a way to trick developers in on their certification-ride). I found how, copy-paste below.

AWS S3 and CloudFront workshop

Last week, I held an AWS workshop on how to host a (dummy) React app there, in S3 and with CloudFront. If you’d like to learn what I taught the others, a github repo is available at https://github.com/tomfa/aws-frontend-workshop.

Elastic Beanstalk with Terraform

If you haven’t already, try to add the Beanstalk application in your environment using only the eb command (see own post). What we do there, is making sure you have the correct setup for vpc and subnets. Once you’ve made sure that is OK, you can come here and try creating the application using terraform. That has…

Continue Reading

Elastic Beanstalk – In a VPC

“The EC2 instances failed to communicate with AWS Elastic Beanstalk”. FUDGE! Notes on how to successfully launch a Beanstalk instance in a VPC.

HTTPS for AWS CloudFront and AWS ELB

Wow, such easy, much free! A few simple steps on 1) How to obtain a certificate for your domain, and 2) how to use it on your CloudFront or Elastic Load Balancer.

Using AWS Route 53 and SES to handle DNS and e-mail

Some notes on using AWS for handling DNS and e-mail.

AWS Elastic Beanstalk

“By using Elastic Beanstalk, developers can focus on developing their application and are freed from deployment-oriented tasks, such as provisioning servers, setting up load balancing, or managing scaling.” – AWS. Here’s a few general notes on what AWS Elastic Beanstalk (or just Beanstalk) is, pricing etc.

Send AWS CloudWatch Alarms to Slack

I have a few servers on AWS. Some information on those, e.g. high load, would be nice to be notified of. Preferably on Slack. How do I do that?

Add S3 bucket + CloudFront using Terraform (example)

Case: I have some frontend app that consists of static files, e.g. a React app packed with WebPack. I want to deploy it to S3, with CloudFront in front of it. (Optional) I also want index.html to be rendered when other paths are requested (such as /food/cake-is-best), and for the site to return 200 status instead of 404.

AWS CodePipeline

CodePipeline is a specification of how your code runs out to production. What it does is connecting source code with a builder (optional) and a deployment platform. For example, you can set it to trigger a deploy to AWS Beanstalk when a Github repository is updated. And with its 1$ / month, it’s practically free to use. However, CodePipeline is…

Continue Reading

Set index.html as default file on S3 bucket

aws s3 website $MY_BUCKET_NAME –index-document index.html

Add S3 bucket using awscli (example)

Here’s a simple step by step guide on how to create a s3 bucket, with an attached cloudfront and a user with write access. This is typically what you want if you need quick hosting for static files for you website. This is made in contrast to the terraform guide, which does the same, but using different tools If…

Continue Reading

Django on Heroku with AWS S3 bucket for static and media files

Case: You want efficient collectstatic and serving of files You want static files and media files to be hosted on an AWS S3 bucket. (optional) You have too many files for “normal” collectstatic to be efficient. (optional) You have a non-US S3 bucket. (optional) You use Heroku Disclaimer: Have not tested with python 2.7, can’t…

Continue Reading

Add S3 bucket using Terraform (example)

Edit: I was going to make the s3 bucket with cloudfront, but Terraform has no native support for it, though it looks like it’s coming soon. I’ll probably make a followup later. Edit 2: I made a followup on how to do it with Cloudfront A concrete, developer friendly guide on how to create a proper s3 bucket with…

Continue Reading

curl headers only

How to grep only the response headers