# DynamoDBResourceExtensions Methods

- Package: [Aspire.Hosting.AWS](/reference/api/csharp/aspire.hosting.aws.md)
- Type: [DynamoDBResourceExtensions](/reference/api/csharp/aspire.hosting.aws/dynamodbresourceextensions.md)
- Kind: `Methods`
- Members: `4`

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

## AddDynamoDBTable(IResourceBuilder<IStackResource>, string, ITableProps)

- Name: `AddDynamoDBTable(IResourceBuilder<IStackResource>, string, ITableProps)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<IConstructResource<Table>>`

```csharp
public static class DynamoDBResourceExtensions
{
    public static IResourceBuilder<IConstructResource<Table>> AddDynamoDBTable(
        this IResourceBuilder<IStackResource> builder,
        string name,
        ITableProps props)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<IStackResource>`)
- `name` (`string`)
- `props` (`ITableProps`)

## AddGlobalSecondaryIndex(IResourceBuilder<IConstructResource<Table>>, IGlobalSecondaryIndexProps)

- Name: `AddGlobalSecondaryIndex(IResourceBuilder<IConstructResource<Table>>, IGlobalSecondaryIndexProps)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<IConstructResource<Table>>`

```csharp
public static class DynamoDBResourceExtensions
{
    public static IResourceBuilder<IConstructResource<Table>> AddGlobalSecondaryIndex(
        this IResourceBuilder<IConstructResource<Table>> builder,
        IGlobalSecondaryIndexProps props)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<IConstructResource<Table>>`)
- `props` (`IGlobalSecondaryIndexProps`)

## AddLocalSecondaryIndex(IResourceBuilder<IConstructResource<Table>>, ILocalSecondaryIndexProps)

- Name: `AddLocalSecondaryIndex(IResourceBuilder<IConstructResource<Table>>, ILocalSecondaryIndexProps)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<IConstructResource<Table>>`

```csharp
public static class DynamoDBResourceExtensions
{
    public static IResourceBuilder<IConstructResource<Table>> AddLocalSecondaryIndex(
        this IResourceBuilder<IConstructResource<Table>> builder,
        ILocalSecondaryIndexProps props)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<IConstructResource<Table>>`)
- `props` (`ILocalSecondaryIndexProps`)

## WithReference(IResourceBuilder<TDestination>, IResourceBuilder<IConstructResource<Table>>, string?)

- Name: `WithReference(IResourceBuilder<TDestination>, IResourceBuilder<IConstructResource<Table>>, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<TDestination>`

```csharp
public static class DynamoDBResourceExtensions
{
    public static IResourceBuilder<TDestination> WithReference<TDestination>(
        this IResourceBuilder<TDestination> builder,
        IResourceBuilder<IConstructResource<Table>> table,
        string? configSection = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<TDestination>`)
- `table` (`IResourceBuilder<IConstructResource<Table>>`)
- `configSection` (`string?`) `optional`
