question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exporting DynamoDB Tables Across Stacks?

See original GitHub issue

The docs talk about how to share an S3 bucket across stacks but I cant seem to get it to work for DynamoDB Tables? There doesnt seem to be any “export” method.

Does this not work Universally? Is there a work-around (maybe cdk.Output)?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
kennucommented, Feb 7, 2019

The new DynamoEventSource for Lambda expects a dynamodb.Table parameter. Is there some way to construct it from a table that is outside of the current stack? Or is there some alternative way to setup a DynamoEventSource?

1reaction
kennucommented, Feb 7, 2019

Meanwhile I used this as a workaround to do the same thing as DynamoEventSource:

  new lambda.EventSourceMapping(this, 'DynamoDBEvent', {
    target: lambdaFunction,
    batchSize: 100,
    eventSourceArn: props.tableStreamArn,
    startingPosition: lambda.StartingPosition.Latest,
  })
  lambdaFunction.addToRolePolicy(new iam.PolicyStatement()
    .addAction('dynamodb:ListStreams')
    .addResource('*')
  )
  lambdaFunction.addToRolePolicy(new iam.PolicyStatement()
    .addActions('dynamodb:DescribeStream', 'dynamodb:GetRecords', 'dynamodb:GetShardIterator')
    .addResource(props.tableStreamArn)
  )
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exporting and importing DynamoDB data using AWS Data ...
You can use AWS Data Pipeline to export data from a DynamoDB table to a file in an Amazon S3 bucket. You can...
Read more >
Options to export selective data from one dynamodb table to ...
You need to write a script to do so. However, you may wish to first export the data to S3 using DynamoDB's native...
Read more >
Migrate DynamoDB tables with zero downtime and no data loss
Learn how to migrate DynamoDB tables with zero downtime and no data loss. AWS recently released new functionality to ease migrations with ...
Read more >
Cross-Stack References in serverless - SST.Dev
For example, you might have your DynamoDB tables created in CDK and your APIs ... A reference is created when one stack creates...
Read more >
Cross-Stack References in Serverless
A cross-stack reference consists of an “Export” and “Fn::ImportValue”. ... For example, you might have your DynamoDB tables created in one service and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found