Skip to content

gordonbondon/choregraphie-dynamodb-lock

Repository files navigation

choregraphie_dynamodb_lock Cookbook

Build Status Cookbook Version

This cookbook provides AWS DynamoDB lock primitive for choregraphie cookbook

Usage

Check choregraphie documentation on how to use primitives in chef recipes.

Primitive attributes

:table - (Required) name of a table to use
:hash_key - (Required) DynamoDB table hash key name
:id - (Required) unique id for lock name
:create_table - (Optional) create DynamoDB table if it's missing. Default: false
:ttl - (Optional) TTL for lock before it expires, in seconds. Default: 30
:expires_key - (Optional) Name of TTL attribute in table . Default: Expires

Example:

dynamodb_lock(table: 'LockTable', hash_key: 'id', id: 'my_node', ttl: 600)

AWS Configuration

Block can be used to provide specific AWS Config:

...
dynamodb_lock(table: 'LockTable', hash_key: 'id', id: 'my_node') do
  require 'aws-sdk-dynamodb'
  Aws.config.update({
    region: 'us-west-2',
  })
end
...

Requirements

Platforms

  • Any platform supported by Chef and the AWS-SDK

Chef

  • Chef 12.6+

References