microsoft / microsoft/aspire

No table in dynamoDblocal after creating it via ResourceReadyEvent

Open
#10,916 1 comment 0 reactions 0 assignees View on GitHub
area-integrations external
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

I have followed the tutorial available here https://aws.amazon.com/blogs/developer/integrating-aws-with-net-aspire/ and the code runs fine, produces the dashboard and I'm able to invoke functions. Additionally the create table command invokes within the ResourceReady method, and shows as successful with a table created:

`
builder.Eventing.Subscribe(dynamoDbLocal.Resource, async (evnt, ct) =>
{
// Configure DynamoDB service client to connect to DynamoDB local.
var serviceUrl = dynamoDbLocal.Resource.GetEndpoint("http").Url;
var ddbClient = new AmazonDynamoDBClient(new AmazonDynamoDBConfig { ServiceURL = serviceUrl });

// Create the Accounts table.
var creatResponse = await ddbClient.CreateTableAsync(new CreateTableRequest
{
TableName = "Accounts",
AttributeDefinitions = new List
{
new AttributeDefinition { AttributeName = "Id", AttributeType = "S" }
},
KeySchema = new List
{
new KeySchemaElement { AttributeName = "Id", KeyType = "HASH" }
},
BillingMode = BillingMode.PAY_PER_REQUEST
});

// Add an account to the Accounts table.
await ddbClient.PutItemAsync(new PutItemRequest
{
TableName = "Accounts",
Item = new Dictionary
{
{ "Id", new AttributeValue("1") },
{ "Name", new AttributeValue("Amazon") },
{ "Address", new AttributeValue("Seattle, WA") }
}
});
});`

Image

But if I connect to the localhost dynamodblocal instance via NoSQL Workbench, the connection is fine but no tables show up? Am I missing something?

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version info

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.