File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 37
37
# Create Lambda execution role
38
38
lambda_role = aws .iam .Role (
39
39
"lambdaExecutionRole" ,
40
- assume_role_policy = json .dumps ({ # Use the json module to convert to a JSON string
40
+ assume_role_policy = json .dumps ({
41
41
"Version" : "2012-10-17" ,
42
42
"Statement" : [{
43
43
"Action" : "sts:AssumeRole" ,
50
50
})
51
51
)
52
52
53
- # Create inline policy for the role instead of a managed policy
53
+ # Create inline policy for the role
54
54
dynamodb_policy = aws .iam .RolePolicy (
55
55
"lambdaRolePolicy" ,
56
56
role = lambda_role .id ,
85
85
})
86
86
)
87
87
88
- # Attach the policy to the role
89
- lambda_dynamodb_policy_attachment = aws .iam .RolePolicyAttachment (
90
- "lambda-dynamodb-policy-attachment" ,
91
- role = lambda_role .name ,
92
- policy_arn = dynamodb_policy .arn
93
- )
94
-
95
88
# Create a Lambda function using the Docker image
96
89
lambda_function = aws .lambda_ .Function ("my-serverless-function" ,
97
90
name = "my-serverless-function" ,
You can’t perform that action at this time.
0 commit comments