Skip to content

Commit 2134919

Browse files
author
Adetokunbo Ige
committed
chore: update policy
Signed-off-by: Adetokunbo Ige <[email protected]>
1 parent 2c56b11 commit 2134919

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

todo-app/__main__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@
9191
)
9292

9393
# Create a Lambda function using the Docker image
94-
lambda_function = aws.lambda_.Function(f"my-serverless-function-{environment}",
94+
lambda_function = aws.lambda_.Function(
95+
f"my-serverless-function-{environment}",
9596
name=f"my-serverless-function-{environment}",
96-
role=lambda_role.arn, # Make sure you have the correct IAM role
97-
package_type="Image", # Specify that this is a Docker image
98-
image_uri=docker_image, # Use the image name from the previous step
99-
memory_size=512, # Example memory size
100-
timeout=30 # Example timeout in seconds
97+
role=lambda_role.arn,
98+
package_type="Image",
99+
image_uri=docker_image,
100+
memory_size=512,
101+
timeout=30,
102+
opts=pulumi.ResourceOptions(depends_on=[lambda_role])
101103
)
102104

103105
# Create an API Gateway REST API

todo-app/lambda_function/lambda.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ async def delete_todo(id: str):
103103
@app.get("/health")
104104
async def health():
105105
try:
106+
logging.debug("Health check initiated")
107+
# Simple check to see if everything is working
106108
return {"message": "Everything looks good!"}
107109
except Exception as e:
108110
logging.error(f"Health check error: {e}")

0 commit comments

Comments
 (0)