TappNetwork / laravel-aws-secrets-manager

Manage environment secrets using AWS Secrets Manager.
MIT License
33 stars 19 forks source link

Authenticating using IAM role when running inside EC2 instance #19

Open hugeps opened 2 years ago

hugeps commented 2 years ago

Guys,

Is it possible to use this library so that instead of providing keys to authenticate to SM SDK you could instead utilise the IAM roles assigned to an executing EC2 instance or a container in ECS/EKS context?

As described here I think: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials_assume_role.html

swilla commented 2 years ago

The package does not specifically pass in credentials, so it in theory should work. Based on the AWS documentation, assumed roles are used if ENV variables are not set or a shared credentials file is not used: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html

Let me know if you have any issues getting it t work. We are more than happy to review any PRs needed to make this happen.