# How to make lens use other aws profile than the default?

**URL:** https://forums.k8slens.dev/t/how-to-make-lens-use-other-aws-profile-than-the-default/3824
**Category:** Feature Requests
**Tags:** kubernetes, cluster
**Created:** [November 4, 2024, 6:52pm UTC](https://forums.k8slens.dev/t/how-to-make-lens-use-other-aws-profile-than-the-default/3824 "2024-11-04T18:52:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![safijunaid17](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@safijunaid17](https://forums.k8slens.dev/u/safijunaid17)
#### Post date: [November 4, 2024, 6:52pm UTC](https://forums.k8slens.dev/t/how-to-make-lens-use-other-aws-profile-than-the-default/3824/1 "2024-11-04T18:52:24Z")

</div>

We have been using lens and it works like a charm when we use it with user’s default secret and access keys configured via aws configure.

However, if I want to assume a role and use that sts caller identity’s secret and access keys, Lens fails to detect that unless we add them under [default] in ~/.aws/credentials.

Is it possible for lens to detect these temporary creds from env vars? Like if we set these secrets in ENV vars , k9s works perfectly fine and uses the assumed role over .aws/credentialls file. But lens always points to default section of credentials file.

Please guide me with a simplest way to work with aws iam role assumptions and its temporary credentials.

Thanks.

---

<div class="post-metadata">

### Author: ![phorsmalahti](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/phorsmalahti/32/560_2.png) [@phorsmalahti](https://forums.k8slens.dev/u/phorsmalahti)
#### Post date: [November 18, 2024, 10:51am UTC](https://forums.k8slens.dev/t/how-to-make-lens-use-other-aws-profile-than-the-default/3824/2 "2024-11-18T10:51:24Z")

</div>

Does setting `AWS_PROFILE` env variable work here?

> **[Configuring environment variables for the AWS CLI - AWS Command Line Interface](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html)**
>
> Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named profile as the default.
