tapir icon indicating copy to clipboard operation
tapir copied to clipboard

Document about dynamodb table schema

Open kimxogus opened this issue 8 months ago • 1 comments

I'm trying to bootstrap dynamodb tables using terraform because of iam policy restriction in my environment.

As there's dynamodb schema in java code, but I don't know how to translate that in terraform dynamodb attribute types.

Could you document dynamodb table schema?

kimxogus avatar Apr 17 '25 05:04 kimxogus

Good point, i will document and maybe just extend the examples with one using Terraform to manage DynamoDb

PacoVK avatar Apr 17 '25 07:04 PacoVK

Hey @PacoVK

Any updates on this? We ran into the same issue. Thanks!

alchemyx avatar Oct 07 '25 12:10 alchemyx

I came up with this, most minimal one I could think of, hope it helps (and is correct):

resource "aws_dynamodb_table" "modules" {
    name                        = "Modules"
    billing_mode                = "PAY_PER_REQUEST" 
    hash_key                    = "id"
    region                      = data.aws_region.current.name
    attribute {
        name = "id"
        type = "S"
    }
}

resource "aws_dynamodb_table" "providers" {
    name                        = "Providers"
    billing_mode                = "PAY_PER_REQUEST" 
    hash_key                    = "id"
    region                      = data.aws_region.current.name
    attribute {
        name = "id"
        type = "S"
    }
}

resource "aws_dynamodb_table" "reports" {
    name                        = "Reports"
    billing_mode                = "PAY_PER_REQUEST" 
    hash_key                    = "id"
    region                      = data.aws_region.current.name
    attribute {
        name = "id"
        type = "S"
    }
}

resource "aws_dynamodb_table" "deploykeys" {
    name                        = "DeployKeys"
    billing_mode                = "PAY_PER_REQUEST" 
    hash_key                    = "id"
    region                      = data.aws_region.current.name
    attribute {
        name = "id"
        type = "S"
    }
}

Added this in PR #503

alchemyx avatar Oct 08 '25 06:10 alchemyx

Thanks to @alchemyx PR #503 this is solved

PacoVK avatar Oct 26 '25 08:10 PacoVK