CodexBloom - Programming Q&A Platform

AWS CloudFormation scenarios to Create DynamoDB Table with 'LimitExceededException' When Specifying Write Capacity

πŸ‘€ Views: 30 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-08
aws cloudformation dynamodb infrastructure-as-code YAML

I can't seem to get I've been banging my head against this for hours. After trying multiple solutions online, I still can't figure this out... I'm working with an scenario where my AWS CloudFormation stack fails during the creation of a DynamoDB table. I'm using the following YAML template to define my resources: ```yaml Resources: MyDynamoDBTable: Type: 'AWS::DynamoDB::Table' Properties: TableName: MyTable AttributeDefinitions: - AttributeName: Id AttributeType: S KeySchema: - AttributeName: Id KeyType: HASH ProvisionedThroughput: ReadCapacityUnits: 5 WriteCapacityUnits: 10000 ``` When I try to create the stack, I get the following behavior message: `LimitExceededException: The maximum write capacity units for a DynamoDB table is 10000.` I double-checked the DynamoDB service quotas, and it appears that I am indeed exceeding the default limit for my AWS account. I've tried creating a new DynamoDB table with lower write capacity units, and that works fine. However, I want to set the desired capacity based on my application's needs without constantly running into these limits. I also attempted to use the `AWS::DynamoDB::Table` resource with `AutoScaling` policies to dynamically adjust the capacity, but I ran into similar limits during the creation process. Here’s a snippet of what I used for auto-scaling: ```yaml WriteCapacityScaling: Type: 'AWS::ApplicationAutoScaling::ScalableTarget' Properties: MaxCapacity: 20000 MinCapacity: 5 ResourceId: !Sub 'table/MyTable' ScalableDimension: 'dynamodb:table:WriteCapacityUnits' ServiceNamespace: 'dynamodb' WriteCapacityPolicy: Type: 'AWS::ApplicationAutoScaling::ScalingPolicy' Properties: PolicyName: WriteCapacityPolicy PolicyType: TargetTrackingScaling ScalingTargetId: !Ref WriteCapacityScaling TargetTrackingScalingPolicyConfiguration: TargetValue: 50 PredefinedMetricSpecification: PredefinedMetricType: DynamoDBWriteCapacityUtilization ``` Any suggestions on how to proceed without hitting these limits? Is there a way to request a limit increase programmatically, or should I modify my approach to avoid these limits entirely? Thanks in advance! This is part of a larger web app I'm building. Am I missing something obvious? This is part of a larger web app I'm building. Has anyone else encountered this? For context: I'm using Yaml on Debian.