cloudflare / cloudflare/serverless-cloudflare-workers

Improvement to way we suggest environment variables

Open
#35 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.