Tag aws

Text to Morse Code

Recently I learnt morse code. It was pretty easy to translate characters to dot/dashes (it took me under a day). I then wrote a Go program to translate text to morse code and back. If anyone wants to play with it, it is available at text2morse.jimmyislive.dev The site is hosted by Netlify and the backend is built using terraform, api-gateway and aws lambda. Enjoy !

Automated setup of a static site on S3 using Terraform

Many people, businesses don’t need a dynamic website. they just need a placeholder on the web that gives information to customers about their business, contact info, address etc. A static website is a pretty easy way to achieve this. AWS S3 allows you to host static content and serve it up as webpages. You can set it up manually by following instructions here. This post provides scripts for automating it via Terraform.

AWS Config

AWS Config is a service provided by AWS to keep track of configurations (and their possible drift) of all the resources you bring up in AWS. When your infrastructure setup is small, you probably don’t have to be worried about a configuration store for your resources. But as you grow, it would become increasingly difficult to manage and keep track of all the moving pieces, especially if you have a team of engineers continually deploying and changing things.

Adding multiple certs to an ALB

If you are using AWS and ALBs, you have the ability to add multiple certs to the ALB and terminate SSL there. While it is easy to do via the AWS console, their documentation is not that clear as to how to do it in an automated way. The following is the code snippet, written with troposphere, to show you how to do it. First create a HTTS listener with a certificate: def create_lb_listener_https(alb, default_target_group, param_cert_one): return Listener(‘LoadBalancerListenerHTTPS’, Port='443’,Protocol='HTTPS’, LoadBalancerArn=Ref(alb), DefaultActions=[Action(Type='forward’,TargetGroupArn=Ref(default_target_group))],# Note, only one cert ARN can be specified here, else you will get an errorCertificates=[Certificate(CertificateArn=Ref(param_cert_one)),])

Docker image tagging in ECR

AWS provides a docker repository called ECR. This is similar to Docker Hub, Artifactory etc and provides a convenient place to place docker images for later use e.g. deployment. ECR supports Docker Image Manifest V2, Schema 2, providing the ability to add multiple tags per image. I recently ran into an issue wherein I tagged an image with multiple tags at build time and then just pushed one tag, thinking all tags would appear on ECR.