Documentation ¶
Index ¶
- Constants
- func CreateDynamoDbClient(config *aws_helper.AwsSessionConfig, ...) (*dynamodb.DynamoDB, error)
- func CreateLockTable(tableName string, tags map[string]string, client *dynamodb.DynamoDB, ...) error
- func CreateLockTableIfNecessary(tableName string, tags map[string]string, client *dynamodb.DynamoDB, ...) error
- func DeleteTable(tableName string, dbClient *dynamodb.DynamoDB) error
- func LockTableCheckSSEncryptionIsOn(tableName string, client *dynamodb.DynamoDB) (bool, error)
- func LockTableExistsAndIsActive(tableName string, client *dynamodb.DynamoDB) (bool, error)
- func UpdateLockTableSetSSEncryptionOnIfNecessary(tableName string, client *dynamodb.DynamoDB, ...) error
- func WaitForTableToBeActiveWithRandomSleep(tableName string, client *dynamodb.DynamoDB, maxRetries int, ...) error
- type CountingSemaphore
- type DeleteTableRetryer
- type TableActiveRetriesExceeded
- type TableDoesNotExist
- type TableEncryptedRetriesExceeded
Constants ¶
const ATTR_LOCK_ID = "LockID"
Terraform requires the DynamoDB table to have a primary key with this name
const DYNAMODB_PAY_PER_REQUEST_BILLING_MODE = "PAY_PER_REQUEST"
const MAX_RETRIES_WAITING_FOR_TABLE_TO_BE_ACTIVE = 30
Default is to retry for up to 5 minutes
const SLEEP_BETWEEN_TABLE_STATUS_CHECKS = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
func CreateDynamoDbClient ¶ added in v0.12.0
func CreateDynamoDbClient(config *aws_helper.AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (*dynamodb.DynamoDB, error)
Create an authenticated client for DynamoDB
func CreateLockTable ¶ added in v0.12.0
func CreateLockTable(tableName string, tags map[string]string, client *dynamodb.DynamoDB, terragruntOptions *options.TerragruntOptions) error
Create a lock table in DynamoDB and wait until it is in "active" state. If the table already exists, merely wait until it is in "active" state.
func CreateLockTableIfNecessary ¶ added in v0.12.0
func CreateLockTableIfNecessary(tableName string, tags map[string]string, client *dynamodb.DynamoDB, terragruntOptions *options.TerragruntOptions) error
Create the lock table in DynamoDB if it doesn't already exist
func DeleteTable ¶ added in v0.12.0
Delete the given table in DynamoDB
func LockTableCheckSSEncryptionIsOn ¶ added in v0.18.0
Return true if the lock table's SSEncryption is turned on
func LockTableExistsAndIsActive ¶ added in v0.13.6
Return true if the lock table exists in DynamoDB and is in "active" state
func UpdateLockTableSetSSEncryptionOnIfNecessary ¶ added in v0.18.0
func UpdateLockTableSetSSEncryptionOnIfNecessary(tableName string, client *dynamodb.DynamoDB, terragruntOptions *options.TerragruntOptions) error
Encrypt the TFState Lock table - If Necessary
func WaitForTableToBeActiveWithRandomSleep ¶ added in v0.66.7
func WaitForTableToBeActiveWithRandomSleep(tableName string, client *dynamodb.DynamoDB, maxRetries int, sleepBetweenRetriesMin time.Duration, sleepBetweenRetriesMax time.Duration, terragruntOptions *options.TerragruntOptions) error
Waits for the given table as described above, but sleeps a random amount of time greater than sleepBetweenRetriesMin and less than sleepBetweenRetriesMax between tries. This is to avoid an AWS issue where all waiting requests fire at the same time, which continually triggered AWS's "subscriber limit exceeded" API error.
Types ¶
type CountingSemaphore ¶ added in v0.12.0
type CountingSemaphore chan empty
func NewCountingSemaphore ¶ added in v0.12.0
func NewCountingSemaphore(size int) CountingSemaphore
A bare-bones counting semaphore implementation based on: http://www.golangpatterns.info/concurrency/semaphores
func (CountingSemaphore) Acquire ¶ added in v0.12.0
func (semaphore CountingSemaphore) Acquire()
func (CountingSemaphore) Release ¶ added in v0.12.0
func (semaphore CountingSemaphore) Release()
type DeleteTableRetryer ¶ added in v0.63.3
type DeleteTableRetryer struct {
client.DefaultRetryer
}
func (DeleteTableRetryer) ShouldRetry ¶ added in v0.63.3
func (retryer DeleteTableRetryer) ShouldRetry(req *request.Request) bool
type TableActiveRetriesExceeded ¶
func (TableActiveRetriesExceeded) Error ¶
func (err TableActiveRetriesExceeded) Error() string
type TableDoesNotExist ¶ added in v0.12.0
func (TableDoesNotExist) Error ¶ added in v0.12.0
func (err TableDoesNotExist) Error() string
type TableEncryptedRetriesExceeded ¶ added in v0.18.0
func (TableEncryptedRetriesExceeded) Error ¶ added in v0.18.0
func (err TableEncryptedRetriesExceeded) Error() string