# How to create IAM user and use it's Access Key and Secret key in Lambda environment variables?

**URL:** <https://forum.serverless.com/t/how-to-create-iam-user-and-use-its-access-key-and-secret-key-in-lambda-environment-variables/16509>\
**Category:** Serverless Framework\
**Tags:** aws, iam\
**Created:** [January 8, 2022, 5:44pm UTC](https://forum.serverless.com/t/how-to-create-iam-user-and-use-its-access-key-and-secret-key-in-lambda-environment-variables/16509 "2022-01-08T17:44:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ribtoks](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@ribtoks](https://forum.serverless.com/u/ribtoks)\
**Post date:** [January 8, 2022, 5:44pm UTC](https://forum.serverless.com/t/how-to-create-iam-user-and-use-its-access-key-and-secret-key-in-lambda-environment-variables/16509/1 "2022-01-08T17:44:16Z")

</div>

Hi

I’d like to create a new IAM user (for programmatic access) with certain policies attached to it and get this user’s access key and secret key in some usable format (e.g. exported to be used within other serverless templates).

How can I achieve that?
