dynamodb

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ATTR_CREATION_DATE = "CreationDate"
View Source
const ATTR_IP = "Ip"
View Source
const ATTR_STATE_FILE_ID = "StateFileId"

The names of attributes we use in the DynamoDB lock table

View Source
const ATTR_USERNAME = "Username"
View Source
const DEFAULT_AWS_REGION = "us-east-1"
View Source
const DEFAULT_MAX_RETRIES_WAITING_FOR_LOCK = 360

Default is to retry for up to 1 hour

View Source
const DEFAULT_READ_CAPACITY_UNITS = 1
View Source
const DEFAULT_TABLE_NAME = "terragrunt_locks"
View Source
const DEFAULT_TEST_REGION = "us-east-1"

For simplicity, do all testing in the us-east-1 region

View Source
const DEFAULT_WRITE_CAPACITY_UNITS = 1
View Source
const MAX_RETRIES_WAITING_FOR_TABLE_TO_BE_ACTIVE = 30

Default is to retry for up to 5 minutes

View Source
const SLEEP_BETWEEN_TABLE_LOCK_ACQUIRE_ATTEMPTS = 10 * time.Second
View Source
const SLEEP_BETWEEN_TABLE_STATUS_CHECKS = 10 * time.Second

Variables

View Source
var StateFileIdMissing = fmt.Errorf("state_file_id cannot be empty")

Functions

func New

func New(conf map[string]string) (locks.Lock, error)

New is the factory function for DynamoDbLock

Types

type AcquireLockRetriesExceeded

type AcquireLockRetriesExceeded struct {
	ItemId  string
	Retries int
}

func (AcquireLockRetriesExceeded) Error

func (err AcquireLockRetriesExceeded) Error() string

type AttributeMissing

type AttributeMissing struct {
	AttributeName string
}

func (AttributeMissing) Error

func (err AttributeMissing) Error() string

type DynamoDbLock

type DynamoDbLock struct {
	StateFileId    string
	AwsRegion      string
	TableName      string
	MaxLockRetries int
}

A lock that uses AWS's DynamoDB to acquire and release locks

func (DynamoDbLock) AcquireLock

func (dynamoDbLock DynamoDbLock) AcquireLock(terragruntOptions *options.TerragruntOptions) error

Acquire a lock by writing an entry to DynamoDB. If that write fails, it means someone else already has the lock, so retry until they release the lock.

func (DynamoDbLock) ReleaseLock

func (dynamoDbLock DynamoDbLock) ReleaseLock(terragruntOptions *options.TerragruntOptions) error

Release a lock by deleting an entry from DynamoDB.

func (DynamoDbLock) String

func (dynamoLock DynamoDbLock) String() string

Print a string representation of this lock

type InvalidDateFormat

type InvalidDateFormat struct {
	Date          string
	UnderlyingErr error
}

func (InvalidDateFormat) Error

func (err InvalidDateFormat) Error() string

type InvalidMaxLockRetriesValue

type InvalidMaxLockRetriesValue struct {
	ValidationErr error
}

func (*InvalidMaxLockRetriesValue) Error

func (err *InvalidMaxLockRetriesValue) Error() string

type TableActiveRetriesExceeded

type TableActiveRetriesExceeded struct {
	TableName string
	Retries   int
}

func (TableActiveRetriesExceeded) Error

func (err TableActiveRetriesExceeded) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL