Hero's backgroundHero's background
Connectors / aws-dynamodb

Connect to AWS DynamoDB

AWS DynamoDB is a fully managed, serverless NoSQL database with fast and predictable performance  that allows developers to store and retrieve data at scale. Connectors enables applications to securely read data from any DynamoDB table with batching support for N+1 scenarios.

Try out the Connector!

  • Click ► AllTables to run the operation. You just got back real data from a DynamoDB table! Don't see AllTables? Try closing the tab in Sandbox.

    Due to Sigv4, if you want to try this out with your tables you will need to run the Connector with your AWS keys. Scroll down for instructions

  • Toggle the Response dropdown and select Query Plan. This is the strategy for executing an incoming operation efficiently.

  • Toggle the Query Plan dropdown to Connectors Debugger to click into the details of each request.

Get started with your DynamoDB Tables

  • Create a new graph in GraphOS and follow the "Set up your local development environment" instructions.

  • Create a user in IAM with at least dynamodb:ListTables, dynamodb:GetItem and dynamodb:DescribeTable permissions for the table you created (AWS docs) - create an Access Key for quick testing or see the Apollo docs for IAM roles configuration.

  • Update your local router.yaml file to configure Sigv4 authentication:

authentication:
  connector:
    sources:
      products.dynamodb:
      aws_sig_v4:
        default_chain:
          region: "us-east-1"
          service_name: "dynamodb"
        # assume_role:
        #   role_arn: "arn:aws:iam::{accountId}:role/{roleName}"
        #   session_name: "connector"
  • Modify your local schema to reflect the shape of your AWS DynamoDB entries. Make sure to modify the baseURL in the @source directive to reflect the region your AWS DynamoDB is deployed to (example).

  • Run rover dev with your IAM user Access Key for Sigv4 authenticationl.

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
rover dev \
  --supergraph-config supergraph.yaml \
  --router-config router.yaml

Connectors resources