# Export AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY to environment

**URL:** <https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218>\
**Category:** Build Environment\
**Tags:** docker\
**Created:** [February 19, 2016, 12:04pm UTC](https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218 "2016-02-19T12:04:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddwardo](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/eddwardo/32/1008_2.png) [@eddwardo](https://discuss.circleci.com/u/eddwardo)\
**Post date:** [February 19, 2016, 12:04pm UTC](https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218/1 "2016-02-19T12:04:19Z")

</div>

Hey, I have a problem with exporting credentials from `~/.aws/credentials` to environment so they become available as`$AWS_SECRET_ACCESS_KEY` and `$AWS_ACCESS_KEY_ID` during the build. Especially during docker image build as

```auto
docker build --build-arg CIRCLE_BUILD_NUM=$CIRCLE_BUILD_NUM --build-arg AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --build-arg AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY

```

Any hints how to achieve that?

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [February 19, 2016, 6:09pm UTC](https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218/2 "2016-02-19T18:09:08Z")

</div>

Hey,

Have you tried adding both environment variables to your project via the UI’s Project Settings page? That will allow them to be available (exported) to the entire build process (after the machine) section.

To get there, click the gear icon for your project’s settings page, then find the ‘Tweaks’ section and you’ll see a link for environment variables.

---

<div class="post-metadata">

**Author:** ![eddwardo](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/eddwardo/32/1008_2.png) [@eddwardo](https://discuss.circleci.com/u/eddwardo)\
**Post date:** [February 22, 2016, 8:43am UTC](https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218/3 "2016-02-22T08:43:09Z")

</div>

Hey,  
I added both ENV variables and it works.  
It is not the perfect solution, but it is enough to keep me running 😉  
Thanks a mil 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:38am UTC](https://discuss.circleci.com/t/export-aws-access-key-id-and-aws-secret-access-key-to-environment/2218/4 "2018-06-18T11:38:01Z")

</div>

Closed on June 18, 2018, 11:38am UTC


