Checking Backend Status and Logs After Deployment

Checking Backend Status and Logs After Deployment

After deploying your backend on AWS using SAM CLI and CloudFormation, the next crucial step is to check the resource status and review backend logs to ensure all components are functioning correctly.

  • Make sure that API Gateway, Lambda, DynamoDB, etc. have been created successfully and are running.
  • Quickly identify and resolve deployment or logic errors if any issues occur.
  • Prepare for API testing using Postman or your frontend application.
  1. Check CloudFormation Stack and Resource Status

Stack-sampsamdeloy

  • In the Status tab, if the status is CREATE_COMPLETE or UPDATE_COMPLETE, your deployment was successful.

Stack-sampsamdeloy

  • In the Resources tab, view the list of created resources (API Gateway, Lambda, DynamoDB, S3, etc.).

If you see a status like ROLLBACK or FAILED, click on the Events tab to view error details and identify the root cause.

  1. View Lambda Logs with CloudWatch

    • In the AWS Console, go to Lambda → select your deployed function. Click-lambda-sammapp

    • Scroll down and click on the Monitor tab, then select View CloudWatch logs to access detailed logs. Monitor

    • Scroll down and click on the Log streams tab, then select the first log stream. LogSrteam

    • Each time a request is made (GET/POST, etc.), Lambda writes logs to CloudWatch. Here you can:

      • View received requests.
      • Check returned responses.
      • Debug issues if the code crashes or returns a 500 error.
  2. Verify API Gateway Functionality

    • In the AWS Console, go to API Gateway → select the API you just created. API Gateway

    • Go to Stages → select the relevant stage → choose prod.

    • Copy the Invoke URL to prepare for testing with Postman/curl in the next step. Stages Prod

Once you’ve verified that all resources are functioning properly and there are no critical errors in the logs, you’re ready to test your backend API using Postman or integrate with your frontend!