# Reading environment file from s3 in serverless.yml fails

**URL:** <https://forum.serverless.com/t/reading-environment-file-from-s3-in-serverless-yml-fails/11290>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [April 28, 2020, 9:14am UTC](https://forum.serverless.com/t/reading-environment-file-from-s3-in-serverless-yml-fails/11290 "2020-04-28T09:14:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsof](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/nsof/32/4184_2.png) [@nsof](https://forum.serverless.com/u/nsof)\
**Post date:** [April 28, 2020, 9:14am UTC](https://forum.serverless.com/t/reading-environment-file-from-s3-in-serverless-yml-fails/11290/1 "2020-04-28T09:14:20Z")

</div>

I’m trying to load the environment directly from a s3 bucket but I’m getting “Invalid characters in environment variable 0”  
Here is the relevant section of the serverless.yml

```
provider:
  name: aws
  environment:
    ${s3:####/serverless/#####/production/.env.production.json}

```

Running with the same file locally works  
` ${file(.env.production.json)}`

Any idea?
