AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.


A data mapping abstraction over the AWS SDK for Ruby's client for Amazon DynamoDB.

This library is currently under development. More features will be added as we approach general availability, and while our initial release has as small of an API surface area as possible, the interface may change before the GA release.

We would like to invite you to be a part of the ongoing development of this gem. We welcome your contributions, and would also be happy to hear from you about how you would like to use this gem. Feature requests are welcome.

Links of Interest


Aws::Record is available as the aws-record gem from RubyGems.

gem install 'aws-record'
gem 'aws-record', '~> 2.0'

This automatically includes a dependency on the aws-sdk-dynamodb gem (part of the modular version-3 of the AWS SDK for Ruby. If you need to pin to a specific version, you can add aws-sdk-dynamodb or aws-sdk-core gem in your Gemfile.


To create a model that uses aws-record features, simply include the provided module:

class MyModel
  include Aws::Record

You can then specify attributes using the aws-record DSL:

class MyModel
  include Aws::Record
  integer_attr :id, hash_key: true
  string_attr  :name, range_key: true
  boolean_attr :active, database_attribute_name: "is_active_flag"

If a matching table does not exist in DynamoDB, you can use the TableConfig DSL to create your table:

cfg = Aws::Record::TableConfig.define do |t|

With a table in place, you can then use your model class to manipulate items in your table:

item = MyModel.find(id: 1, name: "Hello Record") = true

MyModel.find(id: 1, name: "Hello Record") # => nil

item = = 2 = "Item" = false