> For the complete documentation index, see [llms.txt](https://docs.mechcloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mechcloud.io/cloud-computing/stateless-iac/aws/examples-resources-with-cost/dynamodb/on-demand-capacity.md).

# On-Demand Capacity

### Creating a table (Standard) with minimal parameters

```
resources:
  # On-Demand Table (Standard Class)
  - name: test-ondemand-table
    type: aws_dynamodb_table
    props:
      table_name: "test-ondemand-table"
      billing_mode: "PAY_PER_REQUEST"
      table_class: "STANDARD"  # Standard storage class
      attribute_definitions:
        - attribute_name: "id"
          attribute_type: "S"
      key_schema:
        - attribute_name: "id"
          key_type: "HASH"
      tags:
        - key: "Environment"
          value: "test"
```

#### Example price for above configuration

```
test-ondemand-table (action: create)
=> Price (Write request units - price: $0.625/Million-WRU)
=> Price (Read request units - price: $0.125/Million-RRU)
=> Price (Storage (standard))
  => Tier 1 (First 25 GB - price: $0.00/GB-Mo)
  => Tier 2 (Beyond 25 GB - price: $0.25/GB-Mo)
```

### Creating a table (Standard-IA) with minimal parameters

```
resources:
  # On-Demand Table (Infrequent Access)
  - name: test-ondemand-ia-table
    type: aws_dynamodb_table
    props:
      table_name: "test-ondemand-ia-table"
      billing_mode: "PAY_PER_REQUEST"
      table_class: "STANDARD_INFREQUENT_ACCESS"  # 50% cheaper storage, 25% more expensive requests
      attribute_definitions:
        - attribute_name: "id"
          attribute_type: "S"
      key_schema:
        - attribute_name: "id"
          key_type: "HASH"
```

#### Example price for above configuration

```
test-ondemand-ia-table (action: create)
=> Price (Write request units (IA) - price: $0.78/Million-WRU)
=> Price (Read request units (IA) - price: $0.155/Million-RRU)
=> Price (Storage (IA) - price: $0.10/GB-Mo)
```
