@exabugs/dynamodb-client 0.7.4 → 0.8.0

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,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.0] - 2025-12-28
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ - **Removed asanowa-specific parameters for library generalization**
15
+ - Removed `cognito_client_id` parameter (aud verification not needed for generic library)
16
+ - Removed `cognito_admin_ui_client_id` parameter (asanowa-specific, moved to project-specific configuration)
17
+ - Removed `cognito_user_pool_domain` parameter (OAuth flow specific, not needed for JWT verification)
18
+ - Removed `COGNITO_CLIENT_ID` environment variable from Records Lambda
19
+ - Removed `COGNITO_REGION` environment variable (redundant, extracted from user pool ID)
20
+ - Removed Admin UI Cognito parameters from Parameter Store module (asanowa-specific)
21
+
22
+ ### Migration Guide
23
+
24
+ If your project was using the removed parameters:
25
+
26
+ 1. **cognito_client_id**: Remove from module call. JWT verification now works without aud validation for better generalization.
27
+ 2. **cognito_admin_ui_client_id** and **cognito_user_pool_domain**: Move these to your project-specific Parameter Store configuration.
28
+ 3. **COGNITO_REGION**: No longer needed. Region is automatically extracted from `cognito_user_pool_id`.
29
+
30
+ ### What remains
31
+
32
+ - `cognito_user_pool_id`: Still required for JWT signature verification (JWKS endpoint construction)
33
+
34
+ ## [0.7.5] - 2025-12-28
35
+
36
+ ### Removed
37
+
38
+ - **All KMS Settings Verification**: Removed all KMS-related settings to verify if they were actually necessary
39
+ - Removed `aws_iam_role_policy.records_kms_default` IAM policy resource (Lambda execution environment)
40
+ - Removed `aws_iam_role_policy.records_kms` IAM policy resource (Parameter Store access)
41
+ - Removed `kms_key_arn = ""` setting from Lambda function
42
+ - Current Lambda function uses only environment variables, not Parameter Store SecureString
43
+ - This is part of ADR-005 verification to determine the true cause of Lambda Function URL issues
44
+
10
45
  ## [0.7.4] - 2025-12-28
11
46
 
12
47
  ### Fixed
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v0.7.4
2
- // Built: 2025-12-28T10:39:29.906Z
1
+ // @exabugs/dynamodb-client v0.8.0
2
+ // Built: 2025-12-28T12:59:33.043Z
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.4",
3
+ "version": "0.8.0",
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
@@ -65,55 +65,10 @@ resource "aws_iam_role_policy" "records_dynamodb" {
65
65
  })
66
66
  }
67
67
 
68
- # カスタムインラインポリシー: KMSアクセス(Parameter Store用)
69
- # Lambda関数がSecureString環境変数を復号化するために必要
70
- resource "aws_iam_role_policy" "records_kms" {
71
- name = "kms-access"
72
- role = aws_iam_role.lambda_records.id
73
-
74
- policy = jsonencode({
75
- Version = "2012-10-17"
76
- Statement = [
77
- {
78
- Effect = "Allow"
79
- Action = [
80
- "kms:Decrypt"
81
- ]
82
- Resource = "*"
83
- Condition = {
84
- StringEquals = {
85
- "kms:ViaService" = "ssm.${var.region}.amazonaws.com"
86
- }
87
- }
88
- }
89
- ]
90
- })
91
- }
68
+ # Parameter Store用KMSアクセスポリシーを削除(ADR-005による検証)
69
+ # 現在のLambda関数は環境変数のみを使用し、Parameter StoreのSecureStringは使用していない
92
70
 
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
- }
71
+ # KMSデフォルトキーアクセスポリシーを削除(ADR-005による検証)
117
72
 
118
73
  # CloudWatch Logsロググループ
119
74
  resource "aws_cloudwatch_log_group" "lambda_records" {
@@ -151,9 +106,8 @@ resource "aws_lambda_function" "records" {
151
106
  timeout = 30
152
107
  memory_size = 512
153
108
 
154
- # KMS暗号化を明示的に無効化(ADR-004)
155
- # AWS管理のデフォルトKMSキーアクセス権限の問題を回避
156
- kms_key_arn = ""
109
+ # KMS暗号化設定を削除(ADR-005による検証)
110
+ # kms_key_arn = ""
157
111
 
158
112
  # 環境変数
159
113
  environment {
@@ -162,8 +116,6 @@ resource "aws_lambda_function" "records" {
162
116
  REGION = var.region
163
117
  TABLE_NAME = var.dynamodb_table_name
164
118
  COGNITO_USER_POOL_ID = var.cognito_user_pool_id
165
- COGNITO_CLIENT_ID = var.cognito_client_id
166
- COGNITO_REGION = var.region
167
119
  LOG_LEVEL = var.log_level
168
120
  # シャドウ設定(環境変数ベース)
169
121
  SHADOW_CREATED_AT_FIELD = var.shadow_created_at_field
@@ -181,9 +133,8 @@ resource "aws_lambda_function" "records" {
181
133
  # CloudWatch Logsへの依存関係を明示
182
134
  depends_on = [
183
135
  aws_cloudwatch_log_group.lambda_records,
184
- aws_iam_role_policy.records_dynamodb,
185
- aws_iam_role_policy.records_kms,
186
- aws_iam_role_policy.records_kms_default
136
+ aws_iam_role_policy.records_dynamodb
137
+ # aws_iam_role_policy.records_kms # ADR-005による検証のため削除(Parameter Store未使用)
187
138
  ]
188
139
 
189
140
  tags = {
@@ -231,9 +182,7 @@ module "parameter_store" {
231
182
  records_function_arn = aws_lambda_function.records.arn
232
183
 
233
184
  # Cognito設定
234
- cognito_user_pool_id = var.cognito_user_pool_id
235
- cognito_admin_ui_client_id = var.cognito_admin_ui_client_id
236
- cognito_user_pool_domain = var.cognito_user_pool_domain
185
+ cognito_user_pool_id = var.cognito_user_pool_id
237
186
 
238
187
  # DynamoDB設定
239
188
  dynamodb_table_name = var.dynamodb_table_name
@@ -42,60 +42,6 @@ resource "aws_ssm_parameter" "lambda_records_function_arn" {
42
42
  }
43
43
  }
44
44
 
45
- # 外部参照用のパラメータ(実際の値を設定)
46
- # アプリケーション(Admin UI、Fetch Lambda等)がこれらの値を参照する
47
-
48
- # Cognito User Pool ID (Admin UI参照用)
49
- resource "aws_ssm_parameter" "app_admin_ui_cognito_user_pool_id" {
50
- name = "/${var.project_name}/${var.environment}/app/admin-ui/cognito-user-pool-id"
51
- type = local.parameter_type
52
- tier = local.parameter_tier
53
- value = var.cognito_user_pool_id
54
- overwrite = true
55
-
56
- description = "Cognito User Pool ID for Admin UI"
57
-
58
- tags = {
59
- Environment = var.environment
60
- ManagedBy = "terraform"
61
- Category = "app-config"
62
- }
63
- }
64
-
65
- # Cognito Client ID (Admin UI参照用)
66
- resource "aws_ssm_parameter" "app_admin_ui_cognito_client_id" {
67
- name = "/${var.project_name}/${var.environment}/app/admin-ui/cognito-client-id"
68
- type = local.parameter_type
69
- tier = local.parameter_tier
70
- value = var.cognito_admin_ui_client_id
71
- overwrite = true
72
-
73
- description = "Cognito Client ID for Admin UI"
74
-
75
- tags = {
76
- Environment = var.environment
77
- ManagedBy = "terraform"
78
- Category = "app-config"
79
- }
80
- }
81
-
82
- # Cognito Domain (Admin UI参照用)
83
- resource "aws_ssm_parameter" "app_admin_ui_cognito_domain" {
84
- name = "/${var.project_name}/${var.environment}/app/admin-ui/cognito-domain"
85
- type = local.parameter_type
86
- tier = local.parameter_tier
87
- value = "${var.cognito_user_pool_domain}.auth.${var.region}.amazoncognito.com"
88
- overwrite = true
89
-
90
- description = "Cognito Domain for Admin UI"
91
-
92
- tags = {
93
- Environment = var.environment
94
- ManagedBy = "terraform"
95
- Category = "app-config"
96
- }
97
- }
98
-
99
45
  # DynamoDB Table Name (外部参照用)
100
46
  resource "aws_ssm_parameter" "infra_dynamodb_table_name" {
101
47
  name = "/${var.project_name}/${var.environment}/infra/dynamodb-table-name"
@@ -30,16 +30,6 @@ variable "cognito_user_pool_id" {
30
30
  type = string
31
31
  }
32
32
 
33
- variable "cognito_admin_ui_client_id" {
34
- description = "Admin UI用Cognito User Pool Client ID"
35
- type = string
36
- }
37
-
38
- variable "cognito_user_pool_domain" {
39
- description = "Cognito User Pool Domain"
40
- type = string
41
- }
42
-
43
33
  variable "dynamodb_table_name" {
44
34
  description = "DynamoDB Table Name"
45
35
  type = string
@@ -30,21 +30,7 @@ variable "cognito_user_pool_id" {
30
30
  type = string
31
31
  }
32
32
 
33
- variable "cognito_client_id" {
34
- description = "Cognito App Client ID(オプション、指定時は aud を検証)"
35
- type = string
36
- default = ""
37
- }
38
33
 
39
- variable "cognito_user_pool_domain" {
40
- description = "Cognito User Pool Domain"
41
- type = string
42
- }
43
-
44
- variable "cognito_admin_ui_client_id" {
45
- description = "Admin UI用Cognito User Pool Client ID"
46
- type = string
47
- }
48
34
 
49
35
  variable "log_retention_days" {
50
36
  description = "CloudWatch Logsの保持期間(日数)"