-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for DynamoDB Local #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Consider using the var redis = builder.AddAzureRedis("redis").RunAsContainer(); |
src/Aspire.Hosting.AWS/DynamoDB/DynamoDBLocalResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// The container image tag. The default is latest. | ||
/// </summary> | ||
public string Tag { get; set; } = "latest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you want to use latest? It'll make people's experience unstable by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll ping the DynamoDB team to see what they are comfortable with. They don't maintain a floating stable and latest version. So the alternative is hardcoding a specific version requiring a new release of the package every time there is a new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with the DynamoDB team and they feel strongly that they want users using latest
.
My Azure ignorance here but what does |
If you just call
Not even at publish time? What happens then? |
b1c00ca
to
75b28f6
Compare
Within DynamoDB you would provision tables but you don't provision the service. And the tables would be provision via the CloudFormation integration. This is all about setting up the emulator and redirecting the SDK when attempting to access the DynamoDB service go to the local emulator. There is a user experience question on how to create the tables within DynamoDB local because CloudFormation isn't going to do anything with the local emulator. So table creation for DynamoDB local would be done differently then when using the real service. Right now I would do it with adding a "Data Loader" project to the Aspire resource that took care of making sure DynamoDB local had all the table creation and data seeding. What I also want to experiment with is extending the |
75b28f6
to
5693103
Compare
Directory.Packages.props
Outdated
|
||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0-preview.9.24507.7" /> | ||
|
||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not use $(AspireVersion) here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed after rebasing from dev
.
/// <summary> | ||
/// If set to true DynamoDB runs in memory instead of using a database file. DynamoDB local will run faster | ||
/// using InMemory mode but all data will be lost when the container ends and the data stored in DynamoDB | ||
/// local can ont exceed the available memory for the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo in "can ont"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -0,0 +1,71 @@ | |||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |||
|
|||
//using Aspire.Hosting.Testing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove commented out statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file doesn't have the Amazon header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
d7e2432
to
f4d835f
Compare
…ost startup process.
…ne place for options.
…tensions.cs Co-authored-by: David Fowler <[email protected]>
b03d3a0
to
1335ca2
Compare
Description of changes:
Adds a new
AddAWSDynamoDBLocal
extension method for adding the DynamoDB Local container image to the Aspire application. When the DynamoDB Local Aspire resource is added as a reference to projects theAWS_ENDPOINT_URL_DYNAMODB
environment variable is set. DynamoDB service clients created in the application that rely on the SDK to resolve the region/endpoint will pick up the environment variable. TheAWS_ENDPOINT_URL_DYNAMODB
will take precedence over theAWS_REGION
environment variable.Tests and options class exposing all of the options available for DynamoDB local have been added. PR is in draft mode till I confirm the experience with the DynamoDB team.
Sample of what the user experience is like.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.