Skip to content

DynamoDB dynamodb:DescribeTable Error when using OverrideTableName #1421

Closed
@ayongbannayan

Description

@ayongbannayan

I'm using the object persistent model, the name of the DynamoDB table is also dynamic. My queries currently function however when using X-Ray I'm noticing an exception that is occurring after the query.

In my object I am not using the DynamoDBTable attribute because the table name is dynamic. I'm using the DynamoDBOperationConfig and setting the OverrideTableName property.

When excuting QueryAsync the query returns results but X-Ray shows the following

Screen Shot 2019-10-07 at 1 44 25 PM

The error that is occurring is ...not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:ca-central-1:xxxxxxxxx:table/T where T is the name of the object and not the table.

using (DynamoDBContext context = new DynamoDBContext(AmazonDynamoDB))
{
    DynamoDBOperationConfig config = new DynamoDBOperationConfig
    {
        OverrideTableName = “TableName”,
        IndexName = “IndexName”
    };

    AsyncSearch<ObjectType> query = context.QueryAsync<ObjectType>(“HashKey”, config);
    IEnumerable<ObjectType> objects = await query.GetRemainingAsync();
}

I'm not sure how to handle this exception. I've tried to set the DynamoDBTable however the error simply changes to the name I provide instead of the objects Name. Not sure what else I'm missing.

Regards
Artin

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeThis issue requires a breaking change to remediate.bugThis issue is a bug.dynamodbp2This is a standard priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions