Ruby Posts

Serverless APIs With Ruby, AWS Lambda & AWS SAM CLI: Accessing Amazon RDS

Using Ruby for AWS Lambda and Creating a Serverless API to Access Amazon RDS MySQL

Having a Ruby on Rails background, I got excited to try Ruby to code my AWS Lambda functions when its support for AWS Lambda was announced at Re:Invent 2018. Finally, to try Ruby on AWS Lambda, I developed a simple API using AWS Serverless Application Model (SAM) to access an Amazon RDS MySQL database. I wanted to compare it with my experiences of doing this with Python and Node.js.

Although it may seem simple, installing mysql2 gem as a dependency proved itself to be challenging than others, because it has native extensions and depends on the environment you use bundler. As always, Docker simplifies our job by providing a similar environment that our AWS Lambda function runs inside.

In this post, I will make an introduction to AWS SAM CLI and using Ruby for AWS Lambda functions. Let’s begin!

Continue reading the Serverless APIs With Ruby, AWS Lambda & AWS SAM CLI: Accessing Amazon RDS blog post.

Automating Ruby on Rails Deployments with AWS CodeDeploy

Ruby on Rails deployments with AWS CodeDeploy

Automating deployments of your web applications brings many benefits, especially when you run them on AWS. You standardize the process, prevent human errors, and can integrate with other AWS services like EC2 Autoscaling and Elastic Load Balancing. Today I will talk about how to automate your Ruby on Rails deployments using AWS CodeDeploy.

Continue reading the Automating Ruby on Rails Deployments with AWS CodeDeploy blog post.

Storing and Monitoring Rails Logs on Amazon CloudWatch

If you deploy any type of application on AWS, such as a Ruby on Rails web app; then your application will generate large amounts of logs. Hence, you will need to store and monitor these logs somewhere to understand what is going on when an unexpected event occurs. A central log server may be a choice; however, Amazon CloudWatch offers an alternative way without maintaining your log servers and with lots of capabilities.

In today’s blog post, I will describe how you can start storing your application logs on Amazon CloudWatch by using a Ruby on Rails web application as an example. The same principles here would apply to other types of application logs as well.

Continue reading the Storing and Monitoring Rails Logs on Amazon CloudWatch blog post.

Signing S3 Upload Requests With Signature Version 4 in a Rails and AngularJS Application

Amazon S3 Signature v4 Process

In our Ruby on Rails web applications, we use Amazon S3 to store files. Uploading files to Amazon S3 buckets via HTTP requests requires signing the request. The current recommended, and safe signing method is Signature Version 4, and AWS regions opened after January 30, 2014, such as London and Frankfurt, only support this version.

In this blog post, I will try to explain how to sign HTTP requests for Amazon S3 uploads in a Rails application and make requests by using AngularJS ng-file-upload module.

Continue reading the Signing S3 Upload Requests With Signature Version 4 in a Rails and AngularJS Application blog post.