A developer uses AWS SDK for JavaScript to call an S3 bucket from Lambda. They need to ensure uploads are encrypted with customer-managed keys and that future reads still work if KMS permissions rotate. What should be done?
Answer
Set the S3 request’s server-side encryption header to use SSE-KMS with the specific KMS key ARN and ensure the Lambda execution role allows kms:Encrypt/Decrypt for that key
Explanation
SSE-KMS requires the correct per-request encryption settings and KMS permissions tied to the key. This prevents breakage when roles or policies change.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
In an API backed by Lambda, you sometimes see cold-start latency spikes and inconsistent response times. You need deterministic performance for request handling while keeping cost controlled. Which strategy is most aligned with the Lambda execution model and can be implemented as a developer?
View question →
A Lambda function behind an API Gateway REST API returns an HTTP 200, but clients sometimes observe 502/504. The function is instrumented with CloudWatch logs. Which approach best preserves end-to-end request context across Lambda retries and helps pinpoint timeout versus downstream errors?
View question →
You publish events to EventBridge and process them with a Lambda that updates a DynamoDB item. Some events are delivered more than once. You must guarantee that processing is effectively once per event for a given aggregate. Which approach is most appropriate?
View question →
You must implement idempotent order creation in a service that receives repeated POST requests from clients. You can use DynamoDB. Which design most directly satisfies at-least-once delivery while preventing duplicate orders?
View question →
You must process large files uploaded to S3. After upload, you want to trigger processing only for objects that have a specific metadata flag set, and you must avoid processing partially uploaded objects. What event-driven approach fits best?
View question →
When implementing a streaming upload to S3 from a client, you need to minimize memory usage and ensure integrity checks are performed without loading the entire payload. The client sends chunks and includes an overall checksum. Which approach is most appropriate?
View question →