Class: CloudFormation::DynamoDB

Inherits:
Base
  • Object
show all
Defined in:
lib/cloud_formation/dynamo_db.rb

Instance Method Summary collapse

Methods inherited from Base

attribute_list, #build

Instance Method Details

#build_table {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
# File 'lib/cloud_formation/dynamo_db.rb', line 5

def build_table &block
  yield self
  self
end

#serializeObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cloud_formation/dynamo_db.rb', line 10

def serialize
  properties = {
    "Type" => "AWS::DynamoDB::Table",
    "Properties" => {
      "ProvisionedThroughput" => {
        "WriteCapacityUnits" => @write_capacity_units.to_s,
        "ReadCapacityUnits" => @read_capacity_units.to_s
      }
    }
  }
  properties.merge add_key_schemas
end