Need help with aws-rails-provisioner?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

176 Stars 13 Forks Apache License 2.0 42 Commits 9 Opened issues


Define and deploy containerized Ruby on Rails Applications on AWS

Services available


Need anything else?

Contributors list


Build Status

A tool for defining and deploying containerized Ruby on Rails applications on AWS.

is a command line tool using your configurations defined in
file to generate AWS CDK stacks on your behalf, provisioning required AWS resources for running your containerized Ruby on Rails applications on AWS (current supported platform: AWS Fargate) within a few commands.

Stability: Experimental

This tool is under developer preview (beta) stage, with active development, releases might lack features and might have future breaking changes.

Links of Interest

Getting Started


Before using the

gem, you need to have:
  $ npm i -g aws-cdk
  • docker daemon vailable for building images

Install aws-rails-provisioner

gem is available from RubyGems, currently with preview versions.
gem install aws-rails-provisioner --pre

Define aws-rails-provisioner.yml

is a configuration file defining how
bootstraps required AWS resources for your Ruby on Rails applications.
version: '0'

vpc: max_az: 2 enable_dns: true services: my_rails_foo: source_path: ./path/to/my_rails_foo # relative path from aws-rails-provisioner.yml fargate: desired_count: 3 memory: 512 cpu: 256 envs: PORT: 80 RAILS_LOG_TO_STDOUT: true public: true db_cluster: engine: aurora-postgresql db_name: app_development scaling: max_capacity: 5 on_cpu: target_util_percent: 80 scale_in_cool_down: 300 on_requests: requests_per_target: 1000 my_another_rails: ...


for more
examples (see
for a minimal
configuration example). The full configuration options are documented here.

Build and Deploy


is defined, run the build command. This will boostrap AWS CDK stacks and define all required AWS resources and connections in CDK code.
aws-rails-provisioner build

By default, it defines a VPC with public and private subnets, an Amazon RDS Database Cluster, an ECS cluster with AWS Fargate services containing application images. When building with

option a CICD stack will be defined automatically (including a Rails data migration step).
aws-rails-provisioner build --with-cicd

After the build completes, run the deploy command to run CDK code that deploys all defined AWS resources:

aws-rails-provisioner deploy

Instead of deploying everything all at once, you can deploy stack by stack, application by application:

# only deploys the stack creates VPC and ECS cluster
aws-rails-provisioner deploy --init

deploys fargate service and database cluster when defined

aws-rails-provisioner deploy --fargate

deploy CICD stack

aws-rails-provisioner deploy --cicd

deploy only :rails_foo application

aws-rails-provisioner deploy --fargate --service my_rails_foo

After the deployment completes, your applications are now running on AWS Fargate fronted with AWS Application LoadBalancer. You can view your website using the public IP address of the network interface's load balancer.

Note: for applications with databases, rails db migration is needed; the CICD stack contains a migration phase by default, running DB migration commands insides private subnets, connected to the DB Cluster.



is enabled at build, a CICD stack is created. Once deployment completes, an AWS CodePipeline is available with source, build, migration, and deploy phases for your Rails application. You need to commit your Rails application to the CodeCommit source repository in the pipeline with
files to activate the pipeline. Sample
s are availble under
handling application image builds and rails migrations.


command line options see:
aws-rails-provisioner -h


We welcome community contributions and pull requests. See CONTRIBUTING for details.

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.

  • Ask a question on Stack Overflow and tag it with
  • If it turns out that you may have found a bug, or want to submit a feature request, please open an issue



is distributed under Apache License, Version 2.0. See LICENSE for more information.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.