Skip to content

Commit c28e67d

Browse files
committed
Add correct permission
1 parent 12be555 commit c28e67d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

infrastructure/terraform/components/api/module_authorizer_lambda.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module "authorizer_lambda" {
1313

1414
function_name = "authorizer"
1515
description = "Authorizer for Suppliers API"
16+
depends_on = [aws_cloudwatch_log_group.lambda_log_group]
1617

1718
memory = 512
1819
timeout = 20
@@ -52,4 +53,17 @@ data "aws_iam_policy_document" "authorizer_lambda" {
5253
"*"
5354
]
5455
}
56+
57+
statement {
58+
sid = "AllowDynamoDBAccess"
59+
effect = "Allow"
60+
61+
actions = [
62+
"dynamodb:Query"
63+
]
64+
65+
resources = [
66+
aws_dynamodb_table.suppliers.arn
67+
]
68+
}
5569
}

0 commit comments

Comments
 (0)