Skip to content

Add support for adding an existing DynamoDB endpoint as a .NET Aspire resource #123

@bill-poole

Description

@bill-poole

Describe the feature

The DynamoDB Local integration for .NET Aspire (AddAWSDynamoDBLocal) always creates a new container. Other .NET Aspire database integrations allow for connecting to an existing/external database server so the resource is shown in the Aspire dashboard (with health checks), but not managed by Aspire.

Use Case

It is useful to sometimes retain data in DynamoDB after the App Host has terminated. Sometimes we want the data to persist across multiple runs, and sometimes we want to use the NoSQL Workbench to query/manage the data.

We can currently persist data between runs by configuring a volume to write the data; but the in-memory performance is about 10x faster in my experience. Furthermore, that doesn't allow us to query/manage the data using NoSQL Workbench.

We can get the assigned endpoint address, and then paste that into NoSQL Workbench, but it requires writing code, and only works while the App Host is running.

Also, the DynamoDB Local integration does not provide an easy way to provision the database with one or more table definitions, nor data within those tables. Again, we can write code to get the assigned endpoint address and then write code using the DynamoDB SDK to achieve that, but it's inconvenient. We often just want to create tables and initial data using NoSQL Workbench. But we don't want to do that each time we run the App Host. We want to do it once using an existing DynamoDB Local instance and then just have the App Host use that instance.

Proposed Solution

Maybe add an AddAWSDynamoDB extension method that allows specifying any DynamoDB endpoint, which could be a DynamoDB Local endpoint, or an endpoint in an AWS region.

It would also be good to expand the AddAWSDynamoDBLocal extension method to allow specifying table definitions and initial data to insert.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Aspire.Hosting.AWS (or related) package versions

Aspire.Hosting.AWS 9.2.6

Targeted .NET Platform

.NET 9

Operating System and version

Any OS supported by .NET 9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions