Skip to content

Commit 9b1f5cf

Browse files
committed
Address PR review comments: scope IAM permissions and add CLI prerequisites
1 parent c7b9217 commit 9b1f5cf

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

lambda-durable-order-processing-sam/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ Each step is automatically checkpointed, allowing the workflow to resume from th
6060
* [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) installed
6161
* [Node.js 18+](https://nodejs.org/) installed
6262

63+
### Required IAM Permissions
64+
65+
Your AWS CLI user/role needs the following permissions for deployment and testing:
66+
- **CloudFormation**: `cloudformation:DescribeStacks`, `cloudformation:DeleteStack`
67+
- **Lambda**: `lambda:CreateFunction`, `lambda:InvokeFunction`, `lambda:GetFunction`
68+
- **DynamoDB**: `dynamodb:Scan`, `dynamodb:GetItem`
69+
- **CloudWatch Logs**: `logs:DescribeLogGroups`, `logs:FilterLogEvents`, `logs:GetLogEvents`, `logs:TailLogEvents`
70+
- **API Gateway**: `apigateway:GET`
71+
- **IAM**: `iam:CreateRole`, `iam:AttachRolePolicy`, `iam:PassRole`
72+
73+
6374
## Deployment
6475

6576
1. Navigate to the pattern directory:
@@ -244,7 +255,7 @@ Processing payment { orderId: 'order-1764821208592', amount: 91.98 }
244255
Waiting for warehouse processing { orderId: 'order-1764821208592' }
245256
```
246257

247-
### Step 6: Verify DynamoDB Storage
258+
### Step 6: Verify Amazon DynamoDB Storage
248259

249260
Check orders stored in DynamoDB:
250261

lambda-durable-order-processing-sam/template.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Transform: AWS::Serverless-2016-10-31
3-
Description: Order Processing Workflow using Lambda Durable Functions
3+
Description: Order Processing Workflow using AWS Lambda Durable Functions
44

55
Globals:
66
Function:
@@ -34,7 +34,6 @@ Resources:
3434
Properties:
3535
CodeUri: src/
3636
Handler: index.handler
37-
Runtime: nodejs22.x
3837
Timeout: 120
3938
AutoPublishAlias: live
4039
DurableConfig:
@@ -47,15 +46,14 @@ Resources:
4746
- Effect: Allow
4847
Action:
4948
- lambda:CheckpointDurableExecution
50-
Resource: '*'
49+
Resource: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-OrderProcessingFunction-*'
5150

5251
# Order Status Function (Non-Durable)
5352
OrderStatusFunction:
5453
Type: AWS::Serverless::Function
5554
Properties:
5655
CodeUri: src/
5756
Handler: status.handler
58-
Runtime: nodejs22.x
5957
Timeout: 30
6058
Policies:
6159
- DynamoDBReadPolicy:

0 commit comments

Comments
 (0)