# AWS Lambda environment variables cleared/removed on sls deploy

**URL:** <https://forum.serverless.com/t/aws-lambda-environment-variables-cleared-removed-on-sls-deploy/6762>\
**Category:** Serverless Framework\
**Tags:** aws, variables\
**Created:** [December 19, 2018, 4:40pm UTC](https://forum.serverless.com/t/aws-lambda-environment-variables-cleared-removed-on-sls-deploy/6762 "2018-12-19T16:40:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhernand3z](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rhernand3z](https://forum.serverless.com/u/rhernand3z)\
**Post date:** [December 19, 2018, 4:40pm UTC](https://forum.serverless.com/t/aws-lambda-environment-variables-cleared-removed-on-sls-deploy/6762/1 "2018-12-19T16:40:22Z")

</div>

Hi there!

I wanted a bit of clarification on what the sls deploy command does to existing AWS environment variables.

The issue my team is having is the following:

- We setup Circle CI to deploy our AWS lambdas via `sls deploy --stage` command
- When Circle CI runs `sls deploy` it looks like all existing `environment variables` get removed since we are not setting them in serverless.yml

We don’t want our `environment variables` to get wiped for every deploy, is there a way around this?

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [December 23, 2018, 6:34am UTC](https://forum.serverless.com/t/aws-lambda-environment-variables-cleared-removed-on-sls-deploy/6762/2 "2018-12-23T06:34:48Z")

</div>

I wrote something on this a while ago [Why are my environment variables replaced during Serverless Framework deployments?](https://www.richdevelops.dev/why-are-my-environment-variables-replaced-during-serverless-framework-deployments)

You can’t prevent it from happening but you can probably work around it.
