boto3_dynamodb

Manage DynamoDB Tables using boto3.

Renamed from boto_dynamodb to boto3_dynamodb and updated to call the refactored boto3_dynamodb execution module.

Create and destroy DynamoDB tables. Be aware that this interacts with Amazon’s services, and so may incur charges.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

This module uses boto3, which can be installed via package, or pip.

This module accepts explicit DynamoDB credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:

dynamodb.keyid: GKTADJGHEIQSXMKKRBJ08H
dynamodb.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:
    keyid: GKTADJGHEIQSXMKKRBJ08H
    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
    region: us-east-1
ensure-present:
  boto3_dynamodb.present:
    - name: example
    - region: us-east-1
    - profile: myprofile

Added in version 1.0.0.

exception saltext.boto3.states.boto3_dynamodb.GsiNotUpdatableError[source]

Raised when a global secondary index cannot be updated.

saltext.boto3.states.boto3_dynamodb.__virtual__()[source]

Only load if the boto3_dynamodb execution module is available.

saltext.boto3.states.boto3_dynamodb.present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar='boto3_dynamodb_alarms', hash_key=None, hash_key_data_type=None, range_key=None, range_key_data_type=None, local_indexes=None, global_indexes=None, backup_configs_from_pillars='boto3_dynamodb_backup_configs')[source]

Ensure the DynamoDB table exists and matches the specified configuration.

name (string)

Name of the DynamoDB table.

table_name (string)

Deprecated. Use name instead.

region (string)

Region to connect to.

key (string)

Secret key to be used.

keyid (string)

Access key to be used.

profile (string)

A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.

read_capacity_units (int)

Read capacity units for the table.

write_capacity_units (int)

Write capacity units for the table.

alarms (dict)

Dictionary of alarms to configure for the table.

alarms_from_pillar (string)

Pillar key containing alarms configuration.

hash_key (string)

Name of the hash key for the table.

hash_key_data_type (string)

Data type of the hash key.

range_key (string)

Name of the range key for the table.

range_key_data_type (string)

Data type of the range key.

local_indexes (list)

List of local secondary indexes for the table.

global_indexes (list)

List of global secondary indexes for the table.

backup_configs_from_pillars (string)

Pillar key containing backup configurations.

Example:

ensure-present:
  boto3_dynamodb.present:
    - name: example
saltext.boto3.states.boto3_dynamodb.absent(name, region=None, key=None, keyid=None, profile=None)[source]

Ensure the DynamoDB table does not exist.

name (string)

Name of the DynamoDB table.

region (string)

Region to connect to.

key (string)

Secret key to be used.

keyid (string)

Access key to be used.

profile (string)

A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.

Example:

ensure-absent:
  boto3_dynamodb.absent:
    - name: example