No project description provided
Project description
AWS CDK Construct for DynamoDB Table from PynamoDB Model.
Streamline DynamoDB create and deploy with PynamoDB and AWS CDK.
This package provides a construct for creating a DynamoDB table using the AWS CDK and PynamoDB models. It simplifies the process of creating and deploying DynamoDB tables in your AWS environment.
Define your tables in a reusable and predictable way with infrastructure-as-code.
Installation
From PyPi:
$ pip install cdk-pynamodb
From GitHub:
$ pip install git+https://github.com/altoria/cdk-pynamoDB#egg=cdk-pynamodb
Basic Usage
Create a model that describes your DynamoDB table.
from pynamodb.models import Model
class UserTable(Model):
class Meta:
host = "http://localhost:8000"
table_name = "user-table"
billing_mode = PROVISIONED_BILLING_MODE
read_capacity_units = 10
write_capacity_units = 3
user_id = UnicodeAttribute(hash_key=True)
email = UnicodeAttribute(null=True)
Now, you can import and construct model in AWS CDK
from models import UserTable
from aws_cdk import Stack
from constructs import Construct
class Database(Stack):
def __init__(self, scope: Construct, id_: str):
super().__init__(scope, id_)
self.table = PynamoDBTable.from_pynamodb_model(self, pynamodb_model=UserTable)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk_pynamodb-0.1.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for cdk_pynamodb-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f91cf1d3ed71fa6c0d87e62dc04da6f0625ced6ed97a4e6c2adc08f3cdf4af38 |
|
MD5 | 9400c8c3e809ee606f3cf8e3734c29d5 |
|
BLAKE2b-256 | ccdef2be9bb8a7aa7fcd4f07721631995cd3eec2731d53815a160a3d4af16de4 |