Which SDK/tool for which job
AWS gives you several ways to talk to services: the AWS SDKs (Boto3 for Python, SDK for JavaScript, Java, .NET etc), the AWS CLI, and the AWS CloudShell. For DVA-C02 you need to know how the SDKs authenticate, retry, and handle errors - not just how to call an API.
Credential chain (default provider chain)
SDKs look for credentials in this order: environment variables, then the shared credentials/config file (~/.aws/credentials), then container credentials (ECS task role), then the EC2 instance metadata service (IMDS) for an instance profile role. Always prefer IAM roles over hard-coded access keys - never bake secrets into code or AMIs.
Retries and exponential backoff
AWS SDKs retry throttled or failed requests automatically using exponential backoff with jitter. This spreads out retries so many clients do not all hammer the service at the same instant. You can tune max retry attempts and backoff strategy in the SDK config (for example retryMode 'standard' or 'adaptive' in newer SDKs). Adaptive mode also throttles the client side send rate when it detects the service is struggling.
Idempotency
Many write APIs (like EC2 RunInstances or SQS SendMessage with a deduplication ID) accept a client token so a retried request does not create duplicate resources. Always pass an idempotency token for any operation you might retry.
Waiters and paginators
Waiters poll an API until a resource reaches a desired state (e.g. waiting for an EC2 instance to reach 'running'), saving you from writing your own polling loops. Paginators automatically handle APIs that return results in pages (using NextToken/Marker), looping through all pages for you.
X-Ray for tracing
The X-Ray SDK instruments your code to trace requests across microservices, showing latency and errors per segment/subsegment. Install the X-Ray daemon (or use the CloudWatch agent) to forward trace data; on Lambda, just enable Active Tracing - no daemon needed.
Exceptions and error handling
SDK calls throw service-specific exceptions (e.g. ThrottlingException, ProvisionedThroughputExceededException for DynamoDB). Catch these and apply backoff rather than failing immediately. HTTP 400s are client errors (fix the request), 500s are server errors (safe to retry).
Common exam traps
- Do not hard-code AWS access keys in application code - use IAM roles.
- The default retry behaviour is already exponential backoff with jitter - you rarely need to write your own.
- IMDSv2 requires a session token via a PUT request first, then a GET with that token header - this closes off SSRF vulnerabilities that affected IMDSv1.
- CLI and SDKs share the same underlying credential chain and config files.
What is the order of the default AWS credential provider chain?
Environment variables, then shared credentials/config file, then container role (ECS), then EC2 instance metadata (IMDS) role
tap to reveal
What retry strategy do AWS SDKs use by default?
Exponential backoff with jitter, to avoid many clients retrying at exactly the same moment
tap to reveal
What problem does IMDSv2 fix compared to IMDSv1?
It requires a PUT request for a session token before any GET, closing off SSRF-based credential theft
tap to reveal
What is an idempotency/client token used for?
Ensures a retried write API call does not create a duplicate resource
tap to reveal
What does a Waiter do in an AWS SDK?
Polls an API automatically until a resource reaches a desired state, e.g. waiting for an EC2 instance to be running
tap to reveal
What does a Paginator do?
Automatically loops through all pages of a multi-page API response using NextToken or Marker
tap to reveal
What are the three SDK retry modes?
Legacy, standard, and adaptive - adaptive also throttles the client send rate based on service health
tap to reveal
How do you enable X-Ray tracing on a Lambda function?
Turn on Active Tracing in the function configuration - no X-Ray daemon needed on Lambda
tap to reveal
Why should you avoid hard-coding AWS access keys in code?
It is a security risk - use IAM roles (instance profile, task role, or Lambda execution role) instead
tap to reveal
What does a ThrottlingException from DynamoDB mean and how should your code respond?
The request rate exceeded capacity; the SDK should retry with exponential backoff rather than failing immediately
tap to reveal
What is the difference between a 4xx and 5xx error from an AWS API?
4xx is a client-side error (fix your request); 5xx is a server-side error and generally safe to retry
tap to reveal
Do the AWS CLI and AWS SDKs use separate credential systems?
No - they share the same default credential provider chain and configuration files
tap to reveal
What AWS component do you install to forward X-Ray trace data from EC2/on-premises?
The X-Ray daemon (or the CloudWatch agent), which forwards segments to the X-Ray service
tap to reveal