Sha256: 0ee307ed822fbab7762b151fde1668578416417919421de171defa50cf6f0de0

Contents?: true

Size: 514 Bytes

Versions: 15

Compression:

Stored size: 514 Bytes

Contents

require 'aws-sdk'

Aws.use_bundled_cert!

module TerraformDevKit
  class DynamoDB
    def initialize(credentials, region)
      @db_client = Aws::DynamoDB::Resource.new(
        credentials: credentials,
        region: region
      )
    end

    def get_item(table_name, key)
      table = @db_client.table(table_name)
      table.get_item(key: key)
    end

    def put_item(table_name, item)
      table = @db_client.table(table_name)
      table.put_item(item: item)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
TerraformDevKit-0.1.14 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.13 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.12 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.11 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.10 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.9 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.8 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.7 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.6 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.5 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.4 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.3 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.2 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.1 lib/TerraformDevKit/dynamodb.rb
TerraformDevKit-0.1.0 lib/TerraformDevKit/dynamodb.rb