Troubleshooting the Secrets Manager extension in AWS Systems Manager Cloud Extensions
Find solutions to common problems with the Secrets Manager extension, such as refused requests, stale secrets, and role errors.
Topics
Requests are refused
Symptom: The extension refuses requests from your application.
Check the following causes:
-
The request isn't signed – By default, the runtime requires SigV4. An unsigned request returns
401 MissingAuthenticationToken. A bad signature, a wrong access key ID, or a request time more than 5 seconds off returns403. -
The token is missing – If the server-side request forgery (SSRF) token header check is on, each query and path request must carry the token. Send the token in one of the SSRF token headers. A missing or wrong token returns
403 InvalidSsrfTokenException. Check the SSRF token headers setting for the header names. -
The request carries an X-Forwarded-For header – The extension refuses these requests with
400 BadRequestExceptionwhether the SSRF token header check is on or off. -
The extension hasn't finished loading – The extension returns
503 ServiceUnavailableExceptionuntil it finishes loading. Retry after a short time.
Your application reads an old secret
Symptom: A secret changed or rotated in Secrets Manager, but your application still reads the old value.
The extension serves a cached secret until the cache time to live (TTL) expires. To get the new value now, add refreshNow=true to the request. To get new values sooner in general, check the Cache TTL setting, and lower the value:
aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --query 'effectiveSettings'
A value of 0 makes the extension check Secrets Manager on every request.
Decryption failures
Symptom: Errors when the extension retrieves a secret that a customer managed AWS Key Management Service (AWS KMS) key encrypts.
Check that the IAM execution role allows kms:Decrypt on the KMS key:
{ "Effect": "Allow", "Action": "kms:Decrypt", "Resource": "arn:aws:kms:region:account-id:key/key-id" }
Prefetched secrets aren't in the cache
Check that each Secret ID and each Tag key is correct. Check that the execution role, or the role in Role ARN, can read the secrets. For tag filters, check that the role has secretsmanager:ListSecrets, and for any prefetch, check that the role has secretsmanager:BatchGetSecretValue on *. A request by ARN, or with versionId or versionStage, doesn't use a prefetched entry. Check the logs of the extension in CloudWatch Logs.
A role can't be assumed
Symptom: A request with roleArn returns 400 AccessDeniedException.
Check that the principal of the extension has sts:AssumeRole permission on the target role. Also check that the trust policy of the target role allows the principal to assume the role.
The extension returns 429 errors
Symptom: Requests to the extension fail with 429 ThrottlingException.
The extension has too many calls in flight. The limit is 100, and the limit is lower under memory pressure. Retry after the time in the Retry-After header.