aws secretsmanager: secret value exceeds maximum size
Works around the Secrets Manager 64KB value limit by splitting large secrets across multiple secrets or moving blobs to S3 with a pointer secret. Not for KMS or IAM issues.
TL;DR
Secrets Manager caps values at 64KB; larger blobs (bundles, archives, giant JSON) get rejected. Split the payload across multiple secrets, or store the blob in S3 and keep a pointer secret. The application reassembles or fetches at runtime.
Error
aws secretsmanager: secret value exceeds maximum sizeSteps
- Measure the payload to confirm size is the issue, not malformed content. Expected: the byte count exceeds 65536.
- Option A, split: divide the payload into logical chunks across multiple secrets with a naming convention, and have the application read and reassemble them. Expected: each piece stores successfully.
- Option B, pointer: upload the blob to S3 with tight bucket policies and KMS encryption, then store the S3 path plus access configuration in Secrets Manager. Expected: a tiny secret pointing at the blob.
- Update the application to fetch via the new pattern (multi-read or S3 download at startup). Expected: the app gets the full value at runtime.
- Delete any partial or failed large-value attempts to avoid confusion. Expected: a clean secret layout.
When to use
put-secret-valueorcreate-secretfails on size- Storing bundles, archives, or large JSON documents as secrets
- Designing secret storage for large payloads
When not to use
- KMS or IAM errors on normal-sized secrets
- Values that fit but fail validation (parameter issue)
Tool compatibility
- AWS Secrets Manager (64KB limit); S3 for blob offload
Variant phrasings
secretsmanager 64kb limit workaround
Split across secrets or use S3 with a pointer; the limit is per secret value.
store large json in secrets manager
Chunk it with a naming convention or move the document to S3 and keep the pointer.
Why it happens
Secrets Manager is built for credentials and config, not bulk storage; the 64KB cap keeps the service fast and the API simple. Large payloads belong in object storage with the secret holding only the access path.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst9QQJeEBryXhC366lTpZqQ