手元用DynamoDB alternativeのterraform-provider-aws対応状況
#Terraform
これは何
手元でDynamoDBを使うアプリケーションを開発するときのデータストアとして、本物のDynamoDBを使うのではなく、何らかの代替ソフトウェアを使うことになると思う
そういったソフトウェアにおいて、テーブル定義をterraform-provider-aws経由で管理できるかどうか、をまとめている
注意
terraform-provider-aws側の更新によって、ある時点では対応していたのに非対応に戻ることが考えられる
一覧
dynamodb-local-proxyを通すと利用できる
dynamodb-local
2026/4/16 WarmThroughput フィールドが欠けているため直接は利用できない
対応
ministack
2026/4/16 対応
floci
2026/4/16 対応
非対応
kumo
2026/4/16 UpdateItemが未実装なので非対応
https://github.com/sivchari/kumo/issues/405
未検証
LocalStack
利用にはユーザー登録が必要になったので試していない
Terraformファイル
code:main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
backend "local" {
path = "terraform.tfstate"
}
}
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://localhost:8888"
}
}
resource "aws_dynamodb_table" "no_gsi" {
name = "no_gsi"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "pk"
type = "S"
}
attribute {
name = "sk"
type = "S"
}
hash_key = "pk"
range_key = "sk"
}
resource "aws_dynamodb_table" "with_gsi" {
name = "with_gsi"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "pk"
type = "S"
}
attribute {
name = "sk"
type = "S"
}
attribute {
name = "field1"
type = "S"
}
attribute {
name = "field2"
type = "S"
}
global_secondary_index {
name = "gsi1"
key_schema {
attribute_name = "field1"
key_type = "HASH"
}
projection_type = "ALL"
}
global_secondary_index {
name = "gsi2"
key_schema {
attribute_name = "field2"
key_type = "HASH"
}
key_schema {
attribute_name = "field1"
key_type = "RANGE"
}
projection_type = "ALL"
}
hash_key = "pk"
range_key = "sk"
}