AWSSecretsManager ResourceNotFoundException

0

Hi ,

I am using Java SDK [1.12.166] for secret manager to store and retrieve secrets. After successfully storing the secrets, intermittently getting below exception while retrieving the same. Surprisingly, first time retrieval was successful, second attempt failed with below exception, however it worked on the third attempt. Not sure on what i am missing here ..
Service: AWSSecretsManager; Status Code: 400; Error Code: ResourceNotFoundException; Request ID:

Appreciate any help regarding this.

Thanks, Anand

질문됨 2년 전1185회 조회
1개 답변
0

The error message you shared "ResourceNotFoundException" with a status code of 400 is usually occurs when the specified resource (secret) is not found. Secrets Manager could not have found the resource that you asked for. However since you advised that you are able to retrieve the secret the first time and it fails for subsequent API calls when using the AWS Secrets Manager SDK in Java this could be an issue of using a secret name versus secret Amazon Resource Name (ARN) which might be bringing the inconsistencies.

In your case I would like to confirm if you are using the secret name or the secret ARN when retrieving the secret from Secrets Manager?

When retrieving secrets from AWS Secrets Manager we recommend that you consider using the secret’s ARN as compared to using the secret name, just in case there are instances your code does partial ARN matching : https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen.

Also by using the secret ARN, you can minimize potential errors due to incorrect secret names, and improve consistency and reliability of your interactions with AWS Secrets Manager. For more information see https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html

In the event that you have not been using the secret ARN I therefore kindly request that you test using the secret ARN with your code and advise if this issue still occurs.

I will also recommend that you open a support case if the issue persists to allow our team to check on your specific issue : https://console.aws.amazon.com/support/home

AWS
Lucky_M
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인