diff --git a/terraform/organization/datasources.tf b/terraform/organization/datasources.tf index 3379531..12683c1 100644 --- a/terraform/organization/datasources.tf +++ b/terraform/organization/datasources.tf @@ -14,6 +14,7 @@ data "template_file" "userdata" { template = file("${path.module}/html/index.html") vars = { ENDPOINT = "${module.apigw.endpoint}" + token = "" } } @@ -25,7 +26,8 @@ data "aws_iam_policy_document" "dynamodb" { "dynamodb:Scan", "dynamodb:GetItem", "dynamodb:UpdateItem", - "dynamodb:DeleteItem" + "dynamodb:DeleteItem", + "dynamodb:Query", ] principals { type = "AWS" diff --git a/terraform/organization/dynamodb.tf b/terraform/organization/dynamodb.tf index ef75666..661e4e8 100644 --- a/terraform/organization/dynamodb.tf +++ b/terraform/organization/dynamodb.tf @@ -9,9 +9,14 @@ module "dynamodb" { billing_mode = "PROVISIONED" read_capacity = 20 write_capacity = 20 - hash_key = "id" + hash_key = "username" + range_key = "id" attributes = [ + { + name = "username" + type = "S" + }, { name = "id" type = "N" diff --git a/terraform/organization/html/index.html b/terraform/organization/html/index.html index 5634c1e..a0a8410 100644 --- a/terraform/organization/html/index.html +++ b/terraform/organization/html/index.html @@ -5,7 +5,9 @@