How to use the @aws-cdk/aws-dynamodb.StreamViewType.NEW_AND_OLD_IMAGES function in @aws-cdk/aws-dynamodb

To help you get started, we’ve selected a few @aws-cdk/aws-dynamodb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / amazon-cognito-example-for-external-idp / cdk / src / cdk.ts View on Github external
});

    // ========================================================================
    // Resource: Amazon DynamoDB Table
    // ========================================================================

    // Purpose: serverless, pay as you go, persistent storage for the demo app

    // See also:
    // - https://aws.amazon.com/dynamodb/
    // - https://docs.aws.amazon.com/cdk/api/latest/docs/aws-dynamodb-readme.html

    const itemsTable = new dynamodb.Table(this, "ItemsTable", {
      billingMode: BillingMode.PAY_PER_REQUEST,
      serverSideEncryption: true,
      stream: StreamViewType.NEW_AND_OLD_IMAGES,
      partitionKey: {name: "id", type: dynamodb.AttributeType.STRING}
    });

    const usersTable = new dynamodb.Table(this, "UsersTable", {
      billingMode: BillingMode.PAY_PER_REQUEST,
      serverSideEncryption: true,
      stream: StreamViewType.NEW_AND_OLD_IMAGES,
      partitionKey: {name: "username", type: dynamodb.AttributeType.STRING},
      timeToLiveAttribute: "ttl",
    });

    // ========================================================================
    // Resource: AWS Lambda Function - CRUD API Backend
    // ========================================================================

    // Purpose: serverless backend for the demo app, uses express.js
github aws-samples / amazon-cognito-example-for-external-idp / cdk / src / cdk.ts View on Github external
// See also:
    // - https://aws.amazon.com/dynamodb/
    // - https://docs.aws.amazon.com/cdk/api/latest/docs/aws-dynamodb-readme.html

    const itemsTable = new dynamodb.Table(this, "ItemsTable", {
      billingMode: BillingMode.PAY_PER_REQUEST,
      serverSideEncryption: true,
      stream: StreamViewType.NEW_AND_OLD_IMAGES,
      partitionKey: {name: "id", type: dynamodb.AttributeType.STRING}
    });

    const usersTable = new dynamodb.Table(this, "UsersTable", {
      billingMode: BillingMode.PAY_PER_REQUEST,
      serverSideEncryption: true,
      stream: StreamViewType.NEW_AND_OLD_IMAGES,
      partitionKey: {name: "username", type: dynamodb.AttributeType.STRING},
      timeToLiveAttribute: "ttl",
    });

    // ========================================================================
    // Resource: AWS Lambda Function - CRUD API Backend
    // ========================================================================

    // Purpose: serverless backend for the demo app, uses express.js

    // See also:
    // - https://aws.amazon.com/lambda/
    // - https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-readme.html

    const apiFunction = new lambda.Function(this, "APIFunction", {
      runtime: nodeRuntime,