Chalice: Is it possible to refer to os level environment variable in config.json

Created on 3 Oct 2019  路  3Comments  路  Source: aws/chalice

Hi,
Thank you for providing great python-based serverless framework.

this is not a bug report but a question.

I migrated from serverless framework recently. In __serverless framework__ I could set environment os level environment variables via specific syntax.

create_s3_bucket:
  name: ${env:S3_BUCKET_NAME}

https://serverless.com/framework/docs/providers/aws/guide/variables/#referencing-environment-variables

Is it possible to set os level environment variable in chalice config.json in similar way?

I will be grateful for any information you can provide.

feature-request

Most helpful comment

I was also wondering the same thing. Such a feature will allow to not hardcode some values in the config.json.

All 3 comments

I was also wondering the same thing. Such a feature will allow to not hardcode some values in the config.json.

looking for same thing. when you deploy with CI, not from your laptop you need this feature to pass many env vars, we have 4 aws accounts, now i have to use complex jq commands to modify each config field.

There's similar feature requests that are all related to "dynamic" configuration. One proposal suggested using a "var" file similar to terraform: https://github.com/aws/chalice/issues/1334. Another one that's tangentially related (mapping env vars to cfn app parameters): https://github.com/aws/chalice/issues/608#issuecomment-345391098.

I'm thinking there's a way to consolidate them all.

Was this page helpful?
0 / 5 - 0 ratings