Skip to content

Commit 116363e

Browse files
author
Adetokunbo Ige
committed
chore: update policy
Signed-off-by: Adetokunbo Ige <[email protected]>
1 parent 8b6f6bc commit 116363e

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

todo-app/__main__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# Create Lambda execution role
3838
lambda_role = aws.iam.Role(
3939
"lambdaExecutionRole",
40-
assume_role_policy=json.dumps({ # Use the json module to convert to a JSON string
40+
assume_role_policy=json.dumps({
4141
"Version": "2012-10-17",
4242
"Statement": [{
4343
"Action": "sts:AssumeRole",
@@ -50,7 +50,7 @@
5050
})
5151
)
5252

53-
# Create inline policy for the role instead of a managed policy
53+
# Create inline policy for the role
5454
dynamodb_policy = aws.iam.RolePolicy(
5555
"lambdaRolePolicy",
5656
role=lambda_role.id,
@@ -85,13 +85,6 @@
8585
})
8686
)
8787

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-
9588
# Create a Lambda function using the Docker image
9689
lambda_function = aws.lambda_.Function("my-serverless-function",
9790
name="my-serverless-function",

0 commit comments

Comments
 (0)