Source

Implementation

Provisioner Type

Resource Type

Flavor

Tool

dotenv

Prerequisites:

  • Have python installed, this provisioner is using Python to load the .env file.
Loads environment variables from a local .env file.

type: environment

10-env.provisioners.yaml (view on GitHub) :

- uri: cmd://python3#dotenv
  type: environment
  description: Loads environment variables from a local .env file.
  args:
  - -c
  - |
    import json
    with open('.env') as f:
      content = f.read().strip()
    env_map = dict([x.split("=",1) for x in content.strip().splitlines()])
    print(json.dumps({"resource_outputs": env_map}))