This cookbook provides AWS DynamoDB lock primitive for choregraphie cookbook
Check choregraphie documentation on how to use primitives in chef recipes.
: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)
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
...
- Any platform supported by Chef and the AWS-SDK
- Chef 12.6+