Skip to content

Tags and Admin

Mark Lauter edited this page May 16, 2026 · 5 revisions

Tags and Admin

Tags

DynamoDbLite supports resource tagging on tables, matching the DynamoDB tag API. See Tagging for DynamoDB in the AWS docs.

TagResourceAsync

Adds or overwrites tags on a table.

await client.TagResourceAsync(new TagResourceRequest
{
    ResourceArn = "arn:aws:dynamodb:local:000000000000:table/Users",
    Tags =
    [
        new Tag { Key = "Environment", Value = "development" },
        new Tag { Key = "Team", Value = "backend" }
    ]
});

UntagResourceAsync

Removes tags by key.

await client.UntagResourceAsync(new UntagResourceRequest
{
    ResourceArn = "arn:aws:dynamodb:local:000000000000:table/Users",
    TagKeys = ["Environment"]
});

ListTagsOfResourceAsync

Lists all tags on a table. All tags are returned in a single response.

var response = await client.ListTagsOfResourceAsync(new ListTagsOfResourceRequest
{
    ResourceArn = "arn:aws:dynamodb:local:000000000000:table/Users"
});

foreach (var tag in response.Tags)
    Console.WriteLine($"{tag.Key} = {tag.Value}");

Tags on CreateTable

Tags can be set during table creation:

await client.CreateTableAsync(new CreateTableRequest
{
    TableName = "Users",
    // ... key schema, attribute definitions ...
    Tags =
    [
        new Tag { Key = "Project", Value = "MyApp" }
    ]
});

ARN format

DynamoDbLite uses the format arn:aws:dynamodb:local:000000000000:table/{tableName}. The table name is extracted from the last segment after /.

Validation

  • Maximum 50 tags per resource
  • Tag key maximum length: 128 characters
  • Tag value maximum length: 256 characters
  • Table must exist (throws ResourceNotFoundException otherwise)

Cleanup

Tags are automatically deleted when a table is deleted.

Endpoints & limits

DescribeEndpointsAsync

Returns a mock endpoint for local use.

var response = await client.DescribeEndpointsAsync(new DescribeEndpointsRequest());
// response.Endpoints[0].Address = "dynamodb.localhost"
// response.Endpoints[0].CachePeriodInMinutes = 1440

DescribeLimitsAsync

Returns hardcoded capacity limits.

var response = await client.DescribeLimitsAsync(new DescribeLimitsRequest());
// response.AccountMaxReadCapacityUnits = 80,000
// response.AccountMaxWriteCapacityUnits = 80,000
// response.TableMaxReadCapacityUnits = 40,000
// response.TableMaxWriteCapacityUnits = 40,000

DetermineServiceOperationEndpoint

Returns a static localhost endpoint.

var endpoint = client.DetermineServiceOperationEndpoint(request);
// endpoint.URL = "http://dynamodb.localhost"

Export & import

DynamoDbLite supports local file-based export and import in DYNAMODB_JSON format. Export runs entirely in the background and returns IN_PROGRESS immediately. Import creates the destination table synchronously, then loads items in the background — the table exists by the time the response arrives.

ExportTableToPointInTimeAsync

Exports all items from a table to local files.

var response = await client.ExportTableToPointInTimeAsync(
    new ExportTableToPointInTimeRequest
    {
        TableArn = "arn:aws:dynamodb:local:000000000000:table/Users",
        S3Bucket = "/tmp/exports",
        S3Prefix = "my-export",
        ExportFormat = ExportFormat.DYNAMODB_JSON
    });

Console.WriteLine(response.ExportDescription.ExportArn);
Console.WriteLine(response.ExportDescription.ExportStatus); // IN_PROGRESS

File layout:

{s3Bucket}/{s3Prefix}/AWSDynamoDB/{exportId}/
  manifest-summary.json
  data/
    00000000.json
    00000001.json
    ...

If S3Prefix is omitted or empty, the layout becomes {s3Bucket}/AWSDynamoDB/{exportId}/.

Each data file contains one JSON object per line: {"Item":{...dynamodb json...}}

Files are split at 10,000 items each.

DescribeExportAsync

Check the status of an export.

var status = await client.DescribeExportAsync(new DescribeExportRequest
{
    ExportArn = exportArn
});
Console.WriteLine(status.ExportDescription.ExportStatus); // COMPLETED or FAILED
Console.WriteLine(status.ExportDescription.ItemCount);

ListExportsAsync

List exports, optionally filtered by table ARN.

var response = await client.ListExportsAsync(new ListExportsRequest
{
    TableArn = "arn:aws:dynamodb:local:000000000000:table/Users"
});

ImportTableAsync

Creates a table and imports items from local files.

var response = await client.ImportTableAsync(new ImportTableRequest
{
    S3BucketSource = new S3BucketSource
    {
        S3Bucket = "/tmp/exports",
        S3KeyPrefix = "my-export"
    },
    InputFormat = InputFormat.DYNAMODB_JSON,
    TableCreationParameters = new TableCreationParameters
    {
        TableName = "UsersImported",
        KeySchema =
        [
            new KeySchemaElement { AttributeName = "UserId", KeyType = KeyType.HASH }
        ],
        AttributeDefinitions =
        [
            new AttributeDefinition { AttributeName = "UserId", AttributeType = ScalarAttributeType.S }
        ]
    }
});

The table is created synchronously before the background import begins.

DescribeImportAsync / ListImportsAsync

Check import status and list imports:

var status = await client.DescribeImportAsync(new DescribeImportRequest
{
    ImportArn = importArn
});
Console.WriteLine(status.ImportTableDescription.ImportStatus);
Console.WriteLine(status.ImportTableDescription.ImportedItemCount);

Export/import parity notes

  • Files are written to and read from the local filesystem (not S3)
  • Only DYNAMODB_JSON format is supported (ION is not implemented)
  • Compression is not supported
  • Export runs as a background task; use DescribeExportAsync to poll for completion
  • Import creates the table synchronously, then imports items in the background

Next steps

Clone this wiki locally