UNPKG

@stacksjs/cloud

Version:

The Stacks cloud/serverless integration & implementation.

29 lines (27 loc) 867 B
import type { Construct } from 'constructs'; import type { NestedCloudProps } from '../types'; export declare interface DatabaseStackProps extends NestedCloudProps { vpc: ec2.Vpc } export declare class DatabaseStack { database: dynamodb.Table constructor(scope: Construct, props: DatabaseStackProps) { this.database = new dynamodb.Table(scope, 'Database', { tableName: `${props.slug}-${props.appEnv}-database`, partitionKey: { name: 'id', type: dynamodb.AttributeType.STRING, }, sortKey: { name: 'sort', type: dynamodb.AttributeType.STRING, }, billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, readCapacity: 5, writeCapacity: 5, pointInTimeRecovery: true, removalPolicy: RemovalPolicy.DESTROY, encryption: dynamodb.TableEncryption.AWS_MANAGED, }) } }