Skip to content

Handle environment variables more dynamically #152

@tayzlor

Description

@tayzlor

Problem

Every time someone wants to override something in the bootstrap scripts this involves placing the environment variable in config-default.sh and modifying --extra-vars for Ansible.
We have a similar issue for terraform where we need to modify util.sh to add -var ... on to the terraform plan.
This is not really scalable.

Proposal

Part of the solution is to move to using terraform environment variables (introduced in terraform 0.5). See #148

The other idea is to handle any environment variables by doing something like the following -

  • namespace all environment variables APOLLO_
  • on bootstrap loop all APOLLO_ env variables and build up --extra-vars from those

e.g.

APOLLO_CONSUL_DC=eu-west-1 would become --extra-vars "consul_dc=eu-west-1"

This means when we add new features we do not need to surface any extra code in the bootstrap scripts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions