boto3_dynamodb

Connection module for Amazon DynamoDB using boto3.

Renamed from boto_dynamodb to boto3_dynamodb and rewritten to use the boto3 dynamodb client APIs directly via saltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

configuration:

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

A region may also be specified in the configuration:

dynamodb.region: us-east-1

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

Added in version 1.0.0.

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

Only load if boto3 is available.

saltext.boto3.modules.boto3_dynamodb.list_tags_of_resource(resource_arn, region=None, key=None, keyid=None, profile=None)[source]

Return a dictionary of all tags currently attached to the given resource.

CLI Example:

salt-call boto3_dynamodb.list_tags_of_resource
saltext.boto3.modules.boto3_dynamodb.tag_resource(resource_arn, tags, region=None, key=None, keyid=None, profile=None)[source]

Set the given tags (dict or list of {'Key':..., 'Value':...}) on the given resource.

CLI Example:

salt-call boto3_dynamodb.tag_resource
saltext.boto3.modules.boto3_dynamodb.untag_resource(resource_arn, tag_keys, region=None, key=None, keyid=None, profile=None)[source]

Remove the given tag keys from the given resource.

CLI Example:

salt-call boto3_dynamodb.untag_resource
saltext.boto3.modules.boto3_dynamodb.exists(table_name, region=None, key=None, keyid=None, profile=None)[source]

Check whether the given DynamoDB table exists.

CLI Example:

salt-call boto3_dynamodb.exists
saltext.boto3.modules.boto3_dynamodb.describe(table_name, region=None, key=None, keyid=None, profile=None)[source]

Describe a DynamoDB table.

CLI Example:

salt-call boto3_dynamodb.describe
saltext.boto3.modules.boto3_dynamodb.create_table(table_name, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, hash_key=None, hash_key_data_type=None, range_key=None, range_key_data_type=None, local_indexes=None, global_indexes=None)[source]

Create a DynamoDB table.

CLI Example:

salt-call boto3_dynamodb.create_table
saltext.boto3.modules.boto3_dynamodb.delete(table_name, region=None, key=None, keyid=None, profile=None)[source]

Delete a DynamoDB table.

CLI Example:

salt-call boto3_dynamodb.delete
saltext.boto3.modules.boto3_dynamodb.update(table_name, throughput=None, global_indexes=None, region=None, key=None, keyid=None, profile=None)[source]

Update the provisioned throughput or global secondary indexes of a table.

throughput

A dict with keys read and write.

global_indexes

A list of GlobalSecondaryIndexUpdates entries (passed through to the boto3 API).

CLI Example:

salt-call boto3_dynamodb.update
saltext.boto3.modules.boto3_dynamodb.create_global_secondary_index(table_name, global_index, region=None, key=None, keyid=None, profile=None)[source]

Create a single global secondary index. global_index is an AWS-format dict with IndexName, KeySchema, Projection, ProvisionedThroughput (as returned by extract_index()).

CLI Example:

salt-call boto3_dynamodb.create_global_secondary_index
saltext.boto3.modules.boto3_dynamodb.update_global_secondary_index(table_name, global_indexes, region=None, key=None, keyid=None, profile=None)[source]

Update the provisioned throughput of the given global secondary indexes.

global_indexes

A dict mapping index names to {'read': R, 'write': W}.

CLI Example:

salt-call boto3_dynamodb.update_global_secondary_index
saltext.boto3.modules.boto3_dynamodb.extract_index(index_data, global_index=False)[source]

Parse a legacy-style index specification (dict or list of OrderedDicts, keyed by an outer index key with a list of single-key dicts) and return an AWS API-shape dict suitable for the DynamoDB create_table or update_table calls.

CLI Example:

salt-call boto3_dynamodb.extract_index