cloudflare / cloudflare/serverless-cloudflare-workers
Improvement to way we suggest environment variables
- Dominant language
- JavaScript
- Stars
- 180
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
Docs currently suggest that best practice is to set the env variables `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_AUTH_EMAIL`, `CLOUDFLARE_AUTH_KEY`, `CLOUDFLARE_ZONE_ID` in their environment variables every time they run a script
The best practice is to maintain a set of config files `config/dev.yml` that contains stage-specific config and then read these vars into the `serverless.yml`
e.g.
```
custom:
deployVars: ${file(./config/config.${opt:stage}.yml)}
provider:
name: cloudflare
config:
accountId: ${self:custom.deployVars.CLOUDFLARE_ACCOUNT_ID}
zoneId: ${self:custom.deployVars.CLOUDFLARE_ZONE_ID}
```
Contributor guide
Assessment
This issue has not been assessed yet.