Closed ksteiny closed 6 years ago
Yep - this is intentional. If your variable is truly not required you can use the optional syntax.
OPTIONAL_VARIABLE: ## Optional variable syntax. Undefined variables will otherwise cause failures
value: ${env:SOME_POSSIBLY_UNDEFINED_VARIABLE}
optional: true
but thats the thing. my variable is required. its not optional. But we have a chicken and an egg scenario with this variable IA_TYPEORM_HOST: ${cft:api-starter-infrastructure-stack.RDSEndpoint}
on every application (the first time its deployed). I have to comment out this line (because that stack doesn't exist), deploy my infrastructure stack (through every environment manually), and then re-enable the variable
The only way to inject CFT properly if it's tied to the stack you're running on is to deploy the CFT first and then run dotenvi
.
if cred: or cft: variable doesn't exist, it fails. it would be nice if undefined printed a warning and then remove the variable from .env vs a failure