@exabugs/dynamodb-client 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.7.4] - 2025-12-28
11
+
12
+ ### Fixed
13
+
14
+ - **Lambda KMS Encryption**: Disabled KMS encryption for Lambda function to resolve persistent KMSAccessDeniedException (ADR-004)
15
+ - **Lambda Startup**: Fixed Lambda function startup failure by explicitly setting `kms_key_arn = ""`
16
+ - **502 Bad Gateway**: Resolved Function URL errors caused by Lambda execution environment KMS issues
17
+
18
+ ### Changed
19
+
20
+ - **Security Model**: Moved from KMS-encrypted Lambda environment to unencrypted for compatibility
21
+ - **ADR-003 Deprecated**: Replaced complex KMS permission approach with simpler encryption disable approach
22
+
23
+ ### Technical
24
+
25
+ - **Terraform**: Added `kms_key_arn = ""` to Lambda function configuration
26
+ - **Architecture Decision**: Created ADR-004 to document KMS encryption disable decision
27
+
28
+ ## [0.7.3] - 2025-12-28
29
+
30
+ ### Fixed
31
+
32
+ - **Lambda KMS Access**: Added AWS default KMS key access permissions for Lambda execution environment (ADR-003)
33
+ - **KMSAccessDeniedException**: Resolved Lambda startup failure due to missing KMS permissions
34
+ - **Lambda Runtime**: Added conditional access to default KMS key used by Lambda service for function protection
35
+
36
+ ### Security
37
+
38
+ - **KMS Permissions**: Limited KMS access to Lambda service only with conditional access control
39
+ - **Least Privilege**: Maintained security with service-specific KMS access restrictions
40
+
10
41
  ## [0.7.2] - 2024-12-28
11
42
 
12
43
  ### Fixed
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v0.7.2
2
- // Built: 2025-12-28T10:11:50.560Z
1
+ // @exabugs/dynamodb-client v0.7.4
2
+ // Built: 2025-12-28T10:39:29.906Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exabugs/dynamodb-client",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "DynamoDB Single-Table Client SDK with MongoDB-like API, Shadow Records, and Lambda implementation for serverless applications",
5
5
  "author": "exabugs",
6
6
  "license": "MIT",
package/terraform/main.tf CHANGED
@@ -90,6 +90,31 @@ resource "aws_iam_role_policy" "records_kms" {
90
90
  })
91
91
  }
92
92
 
93
+ # カスタムインラインポリシー: KMSデフォルトキーアクセス(Lambda実行環境用)
94
+ # AWS LambdaのデフォルトKMSキーへのアクセス権限(ADR-003)
95
+ resource "aws_iam_role_policy" "records_kms_default" {
96
+ name = "kms-default-access"
97
+ role = aws_iam_role.lambda_records.id
98
+
99
+ policy = jsonencode({
100
+ Version = "2012-10-17"
101
+ Statement = [
102
+ {
103
+ Effect = "Allow"
104
+ Action = [
105
+ "kms:Decrypt"
106
+ ]
107
+ Resource = "*"
108
+ Condition = {
109
+ StringEquals = {
110
+ "kms:ViaService" = "lambda.${var.region}.amazonaws.com"
111
+ }
112
+ }
113
+ }
114
+ ]
115
+ })
116
+ }
117
+
93
118
  # CloudWatch Logsロググループ
94
119
  resource "aws_cloudwatch_log_group" "lambda_records" {
95
120
  name = "/aws/lambda/${var.project_name}-${var.environment}-records"
@@ -126,6 +151,10 @@ resource "aws_lambda_function" "records" {
126
151
  timeout = 30
127
152
  memory_size = 512
128
153
 
154
+ # KMS暗号化を明示的に無効化(ADR-004)
155
+ # AWS管理のデフォルトKMSキーアクセス権限の問題を回避
156
+ kms_key_arn = ""
157
+
129
158
  # 環境変数
130
159
  environment {
131
160
  variables = {
@@ -153,7 +182,8 @@ resource "aws_lambda_function" "records" {
153
182
  depends_on = [
154
183
  aws_cloudwatch_log_group.lambda_records,
155
184
  aws_iam_role_policy.records_dynamodb,
156
- aws_iam_role_policy.records_kms
185
+ aws_iam_role_policy.records_kms,
186
+ aws_iam_role_policy.records_kms_default
157
187
  ]
158
188
 
159
189
  tags = {