Skip to content

Commit f45c667

Browse files
committed
WIP
1 parent b95b17f commit f45c667

4 files changed

Lines changed: 119 additions & 5 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "aws_dynamodb_table" "upsert_idempotency" {
2+
name = "${local.csi}-upsert-idempotency"
3+
billing_mode = "PAY_PER_REQUEST"
4+
hash_key = "id"
5+
attribute {
6+
name = "id"
7+
type = "S"
8+
}
9+
ttl {
10+
attribute_name = "expiration"
11+
enabled = true
12+
}
13+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
resource "aws_iam_role" "upsert_idempotency_role" {
2+
name = "${local.csi}-upsert-idempotency-role"
3+
4+
assume_role_policy = jsonencode({
5+
Version = "2012-10-17"
6+
Statement = [
7+
{
8+
Sid = ""
9+
Effect = "Allow"
10+
Principal = {
11+
Service = "lambda.amazonaws.com"
12+
}
13+
Action = "sts:AssumeRole"
14+
},
15+
]
16+
})
17+
}
18+
19+
resource "aws_iam_policy" "LambdaDynamoDBPolicy" {
20+
name = "LambdaDynamoDBPolicy"
21+
description = "IAM policy for Lambda function to access DynamoDB"
22+
policy = jsonencode({
23+
Version = "2012-10-17"
24+
Statement = [
25+
{
26+
Sid = "AllowDynamodbReadWrite"
27+
Effect = "Allow"
28+
Action = [
29+
"dynamodb:PutItem",
30+
"dynamodb:GetItem",
31+
"dynamodb:UpdateItem",
32+
"dynamodb:DeleteItem",
33+
]
34+
Resource = aws_dynamodb_table.IdempotencyTable.arn
35+
},
36+
]
37+
})
38+
}
39+
40+
resource "aws_iam_role_policy_attachment" "IdempotencyFunctionRoleAttachment" {
41+
role = aws_iam_role.IdempotencyFunctionRole.name
42+
policy_arn = aws_iam_policy.LambdaDynamoDBPolicy.arn
43+
}

package-lock.json

Lines changed: 58 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"@aws-sdk/client-s3": "^3.925.0",
66
"@aws-sdk/client-sns": "^3.936.0",
77
"@openapitools/openapi-generator-cli": "^2.21.4",
8+
"@playwright/test": "^1.57.0",
89
"@redocly/cli": "1.31.0",
910
"@stoplight/spectral-cli": "^6.15.0",
1011
"@stylistic/eslint-plugin": "^5.9.0",
@@ -14,7 +15,6 @@
1415
"@types/node": "^25.2.2",
1516
"@typescript-eslint/eslint-plugin": "^8.46.2",
1617
"@typescript-eslint/parser": "^8.27.0",
17-
"@playwright/test": "^1.57.0",
1818
"ajv": "^8.17.1",
1919
"allure-commandline": "^2.34.1",
2020
"allure-playwright": "^3.4.3",
@@ -135,5 +135,8 @@
135135
"scripts/utilities/*",
136136
"tests",
137137
"tests/contracts/*"
138-
]
138+
],
139+
"dependencies": {
140+
"@aws-lambda-powertools/idempotency": "^2.33.0"
141+
}
139142
}

0 commit comments

Comments
 (0)