Skip to content

bug: DynamoDB DescribeTable response missing WarmThroughput field causes Terraform AWS Provider v6.13.0+ infinite polling loop #13140

@kmtym1998

Description

@kmtym1998

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using Terraform AWS Provider v6.13.0+ with LocalStack to create DynamoDB tables, the provider enters an infinite polling loop after successful table creation. The table is created successfully and shows TableStatus: "ACTIVE", but Terraform never completes the apply operation and eventually times out with "couldn't find resource (21 retries)" errors.

The root cause is that LocalStack's DescribeTable response is missing the WarmThroughput field that AWS DynamoDB includes in its responses. The Terraform AWS Provider checks for WarmThroughput.Status and loops indefinitely when WarmThroughput is missing.

Expected Behavior

LocalStack's DescribeTable response should include the WarmThroughput field to maintain compatibility with the AWS DynamoDB API specification and allow Terraform AWS Provider v6.13.0+ to complete table operations successfully.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

# docker-compose.yml
services:
  localstack:
    container_name: localstack
    image: localstack/localstack:latest
    platform: linux/arm64
    ports:
      - 10002:4566
    environment:
      - SERVICES=dynamodb
      - AWS_DEFAULT_REGION=ap-northeast-1
    healthcheck:
      test: |
        curl -s http://localhost:4566/_localstack/init/ready | grep '\"completed\": true'
      interval: 10s
      start_period: 5s
      timeout: 5s
      retries: 6
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

  terraform:
    container_name: terraform
    image: hashicorp/terraform:latest
    platform: linux/arm64
    volumes:
      - ./infra/local:/tmp/terraform
    working_dir: /workdir
    env_file:
      - ./api/.env
    entrypoint: [""]
    command: |
      /bin/sh /tmp/terraform/command.sh
    depends_on:
      localstack:
        condition: service_healthy

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

# main.tf
terraform {
  backend "local" {}
}

provider "aws" {
  region = "ap-northeast-1"
  access_key = "dummy"
  secret_key = "dummy"
  skip_credentials_validation = true
  skip_metadata_api_check     = true
  skip_requesting_account_id  = true

  endpoints {
    dynamodb = "http://localstack:4566"
  }
}

resource "aws_dynamodb_table" "example" {
  name         = "example-table"
  billing_mode = "PAY_PER_REQUEST"
  hash_key     = "id"

  attribute {
    name = "id"
    type = "S"
  }
}
# command.sh
#!/bin/sh
terraform init
TF_LOG=DEBUG terraform apply --auto-approve
  1. Place main.tf, docker-compose.yml, and command.sh in the appropriate directory.
  2. Run docker compose run --rm terraform.
  3. Apply operation times out after 2~3 minutes

Environment

- OS: macOS (Docker container: linux/arm64)
- LocalStack:
  LocalStack version: 4.8.1.dev4
  LocalStack Docker image: localstack/localstack:latest
  LocalStack build date: 2025-09-12
  LocalStack build git hash: 54de5230b

Anything else?

I've opened a similar issue in the terraform-provider-aws repository. It appears that LocalStack needs to be updated to align with the latest AWS specifications.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions