Retrieve secrets from secret manager without using SDK

-1

I want to retrieve the AWS secrets without using the SDK because SDK adds lots (300+) of dependencies. I wanted to know if retrieving the secret using REST APIs and IAM Role/User is possible. And if yes then how?

I am building a microservice using Micronaut and want to avoid adding extra jars.

2 Antworten
0
Akzeptierte Antwort

Hi,

Which language are you using, and from where are you planning to call the AWS Secret Manager API ?

You can sign you own request and directly call the GetSecretValue API action.

But keep in mind that you will then need to maintain this part of code and make sure that you are handling credentials discovery and usage properly.

profile pictureAWS
beantwortet vor 10 Monaten
profile picture
EXPERTE
überprüft vor 10 Monaten
  • Hi, I am using Java with Micronaut. In the article "sign you own request" the below line is mentioned in step 5: Credential=AKIAIOSFODNN7EXAMPLE/20220830/us-east-1/ec2/aws4_request, what does "AKIAIOSFODNN7EXAMPLE" signifies? Is there any recommended way to add this piece of information to the Micronaut application without any hard coding?

  • You should rely on an IAM instance profile to get temporary credentials if your application is running on an EC2 instance.

    But again, the role of the SDK is to abstract and simplify this process and I would recommend using it. Do you have any specific size constraints that make the size of the SDK such an important factor ?

0

If using lambdas, you can consider using Parameter and Secrets lambda layer which allows you to cache secrets in lambda side: https://aws.amazon.com/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/

profile picture
EXPERTE
beantwortet vor 10 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen