title: How to set DynamoDB Read/write capacity mode to On-demand on CloudFormation
body: <p>I've seen this <a href="https://aws.amazon.com/blogs/aws/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/" rel="noreferrer">site</a> about DynamoDB On-demand and I updated my tables, created by CloudFormation, to On-demand. Now, when I try to update my Stack, I get this error:</p>
  
  <blockquote>
    <p>One or more parameter values were invalid: Neither ReadCapacityUnits nor WriteCapacityUnits can be specified when BillingMode is PAY_PER_REQUEST</p>
  </blockquote>
  
  <p>Is there a way to set DynamoDB Read/write capacity mode to On-demand on CloudFormation? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've updated to On-demand on AWS Console.</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>My template:</p>
  
  <pre><code>DynamoDBUsersTable:
      Type: AWS::DynamoDB::Table
      Description: Users table
      Properties:
        TableName: !Sub ${StackName}-users-table
        AttributeDefinitions:
          - AttributeName: userId
            AttributeType: S
        KeySchema:
          - AttributeName: userId
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 10
          WriteCapacityUnits: 10
  </code></pre>
  
  <p>Thank you. </p>