AWS Builder Center
One Healthy AWS Service, Five Hidden Dependency Problems: How to Detect and Fix Them

One Healthy AWS Service, Five Hidden Dependency Problems: How to Detect and Fix Them

An AWS application can experience failures even when its primary service appears healthy. Explore five common dependency challenges, how to identify them using AWS monitoring tools, and practical approaches to improve application reliability.

Computer Engineering Student | Aspiring ML Engineer

One Healthy AWS Service, Five Hidden Dependency Problems: How to Detect and Fix Them

Imagine building an online shopping application using AWS Lambda.
Your Lambda function is running successfully. It receives requests, executes without errors, and appears healthy in the monitoring dashboard.
However, customers are experiencing delayed orders, some transactions are incomplete, and certain operations are failing.
What could be happening?
The answer may not be inside the Lambda function itself. It could be related to one of the services that the application depends on.
Modern cloud applications rarely operate using a single service. They connect multiple components to complete a single business operation. Therefore, understanding the health of the primary service is only one part of understanding the health of the overall application.
In this article, we will explore five common dependency challenges, how to assess them, and practical ways to address them using AWS services.

1. Understanding service dependencies

Consider a simple online shopping application:
  • AWS Lambda processes incoming orders.
  • Amazon SQS manages order-processing messages.
  • Amazon DynamoDB stores order information.
  • Amazon S3 stores invoices and related documents.
  • IAM policies control access to AWS resources.
  • An external payment API handles payment requests.
These components work together to complete an operation.
If one dependency experiences an issue, the overall application may experience delays or failures, even when Lambda itself is functioning correctly.
This is why application monitoring should consider both individual services and the relationships between them.
Let's examine five common situations.

2. Five dependency problems and how to address them

Problem 1: Amazon S3 – When files become inaccessible

Scenario:
Suppose your application generates an invoice and stores it in Amazon S3.
The Lambda function executes successfully, but the invoice cannot be uploaded or retrieved.
Possible reasons include:
  • Incorrect bucket or object key.
  • Missing IAM permissions.
  • Bucket policy restrictions.
  • Encryption or access configuration issues.
How to assess it:
Start by examining:
  • Lambda execution logs in Amazon CloudWatch.
  • S3 request errors.
  • Relevant IAM permissions and bucket policies.
  • The exact bucket and object key used by the application.
Look for errors such as  AccessDenied  or  NoSuchKey .
Possible solutions:
  1. Verify that the bucket and object key are correct.
  1. Review the permissions required by the Lambda execution role.
  1. Check the bucket policy and encryption configuration.
  1. Handle missing objects and access failures appropriately in the application.
The objective is to identify whether the issue is related to resource availability, object identification, or access configuration.

Problem 2: Amazon DynamoDB – When database operations become slow

Scenario:
Your Lambda function receives an order and attempts to save its details in DynamoDB.
However, database operations take longer than expected or requests are throttled.
Possible causes include:
  • Insufficient provisioned capacity.
  • Hot partitions caused by uneven access patterns.
  • Throttling.
  • Inefficient queries or data access patterns.
How to assess it:
Use Amazon CloudWatch to examine:
  • SuccessfulRequestLatency.
  • ThrottledRequests.
  • ConsumedReadCapacityUnits.
  • ConsumedWriteCapacityUnits.
Also review the table's partition-key design and application access patterns.
Possible solutions:
  1. Review the partition key to identify uneven traffic distribution.
  1. Evaluate whether on-demand or provisioned capacity is appropriate.
  1. Optimize queries and avoid unnecessary database operations.
  1. Introduce controlled retries for appropriate transient failures.
Monitoring database latency and throttling together can provide a clearer understanding of the problem.

Problem 3: Amazon SQS – When messages accumulate

Scenario:
Your application places order-processing requests into Amazon SQS.
Lambda consumers are responsible for processing these messages.
However, the number of pending messages continues to increase.
Possible reasons include:
  • Consumers are processing messages slowly.
  • Lambda concurrency is limited.
  • Message processing is failing repeatedly.
  • The workload is increasing faster than the available processing capacity.
How to assess it:
Monitor these CloudWatch metrics:
  • ApproximateNumberOfMessagesVisible.
  • ApproximateAgeOfOldestMessage.
  • NumberOfMessagesSent.
  • NumberOfMessagesDeleted.
These metrics help you understand the queue backlog and message-processing behaviour.
Possible solutions:
  1. Investigate why consumers are taking longer to process messages.
  1. Review Lambda concurrency and event source mapping configuration.
  1. Optimize message-processing logic.
  1. Configure a dead-letter queue for messages that repeatedly fail processing.
  1. Monitor the queue age to understand whether the backlog is improving.
Increasing concurrency without considering downstream capacity may create additional pressure on other services. Therefore, scaling decisions should be made carefully.

Problem 4: IAM – When an application cannot access a resource

Scenario:
Your Lambda function attempts to read an object from S3 or write data to DynamoDB.
The function starts successfully, but the requested operation returns an authorization error.
Possible reasons include:
  • Missing permissions in the execution role.
  • Incorrect resource ARNs.
  • Restrictive resource-based policies.
  • Permission boundaries or organizational restrictions.
How to assess it:
Examine:
  • The error messages in CloudWatch Logs.
  • Lambda execution-role permissions.
  • Relevant S3 bucket or DynamoDB resource policies.
  • AWS CloudTrail records for applicable API activity.
Possible solutions:
  1. Identify the exact API operation that failed.
  1. Verify the permissions associated with the execution role.
  1. Check whether the policy references the correct resource.
  1. Apply the principle of least privilege.
  1. Test the required operation after making the appropriate policy changes.
The goal is to provide the necessary access while maintaining appropriate security controls.

Problem 5: External APIs – When an application depends on another system

Scenario:
Your order-processing Lambda function sends a request to an external payment API.
The payment service becomes slow or temporarily unavailable.
As a result, your application may experience timeouts, incomplete operations, or repeated requests.
Possible reasons include:
  • Network delays.
  • API rate limits.
  • Temporary service unavailability.
  • Incorrect timeout configuration.
How to assess it:
Monitor:
  • API response times.
  • HTTP status codes.
  • Request timeout frequency.
  • Failed and retried requests.
Use application logs and distributed tracing to understand how much time is spent waiting for the external service.
Possible solutions:
  1. Configure appropriate connection and request timeouts.
  1. Use exponential backoff with jitter for retryable failures.
  1. Apply retry limits to avoid unnecessary repeated requests.
  1. Consider circuit-breaker patterns where appropriate.
  1. Use idempotency mechanisms for operations where duplicate requests could create unintended side effects.
External dependencies should be treated as components that may occasionally become slow or unavailable.

3. How do we investigate a dependency problem?

Identifying a possible issue is only the beginning. We also need a systematic approach to investigate it.
I would follow five steps.
Step 1: Observe the application behaviour
Understand what is happening from the user's perspective.
Is the application slow? Are requests failing? Are messages accumulating? Are certain operations incomplete?
Step 2: Identify the dependency
Trace the operation through the application and identify which services are involved.
For example, if invoice generation fails, examine the interaction between Lambda and S3.
Step 3: Measure the behaviour
Look at relevant metrics, logs, and traces.
Avoid relying on a single metric. A combination of latency, error rates, throttling, and request volume can provide better diagnostic information.
Step 4: Identify the underlying cause
Determine whether the issue is related to permissions, capacity, configuration, network communication, or application logic.
Step 5: Apply and verify the solution
Make the appropriate change, test the affected operation, and continue monitoring to confirm that the issue has been addressed.
This approach helps avoid unnecessary configuration changes and makes troubleshooting more structured.

4. AWS tools that help assess application dependencies

AWS provides several tools that can help developers understand application behaviour.
Amazon CloudWatch
CloudWatch provides metrics, logs, and alarms. It can help identify changes in latency, errors, throttling, and resource utilization.
AWS X-Ray
AWS X-Ray provides distributed tracing capabilities. It helps developers understand the path of requests across supported application components and identify where delays occur.
Amazon CloudWatch Application Signals
Application Signals provides application-level performance monitoring, including service health and dependency-related insights for supported applications.
AWS CloudTrail
CloudTrail records AWS account activity and API events. It can help investigate resource access, configuration changes, and relevant authorization-related activity.
Each tool provides a different perspective. Using them together can make dependency analysis more effective.

5. A practical dependency health checklist

Before considering an AWS application ready for production, it is useful to review the following questions:
  • Are all required dependencies identified and documented?
  • Are important latency and error metrics monitored?
  • Are appropriate CloudWatch alarms configured?
  • Are IAM permissions limited to required actions?
  • Are timeouts and retry policies configured?
  • Are repeated message-processing failures handled?
  • Can the application respond appropriately when a dependency is unavailable?
  • Are recovery procedures tested?
This checklist can be adapted according to the application's architecture and operational requirements.

6. Final thoughts

Building an AWS application involves more than ensuring that its primary service is running successfully.
A Lambda function may execute correctly while a database operation is throttled, an S3 object is inaccessible, or an external API is unavailable.
These situations highlight the importance of understanding how application components interact.
Monitoring individual services is important, but understanding their dependencies provides a broader view of application health.
The objective is not simply to identify failures after they occur. It is to build applications that can detect problems, respond appropriately, and recover in a controlled manner.
Let's Discuss
When monitoring an AWS application, which do you find more useful: monitoring individual service metrics or tracing the complete request across multiple dependencies?
What tools or practices have helped you identify dependency-related issues in your projects?
I'd be interested to learn from your experiences and approaches.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article