https://pulumi.com logo
b

busy-dusk-74339

01/22/2020, 10:38 PM
is there any way to reference environment variables in pulumi config?
h

handsome-truck-95168

01/22/2020, 10:42 PM
Would a relative directory work?
vault:ca_cert_dir ./pogos2/certs
?
b

busy-dusk-74339

01/22/2020, 10:43 PM
yeah, i could commit the cert to my pulumi repo and probably get away with a relative path
but if you start multiplying that pattern it gets annoying pretty quickly
b

brave-angle-33257

01/23/2020, 12:04 AM
on my setup I had some layer of python on top of pulumi, it would inject ENV vars for dynamic things like build IDs in at runtime on pulumi, then in the typescript code can do:
Copy code
// SERVICE KEY from outside
        if ( typeof(process.env['TASK_REVISION']) === 'undefined' ) {
            console.log("TASK_REVISION env var missing! Please specify it with `pulumi up`");
        }
        var task_revision = String(process.env['TASK_REVISION']);
but any type of CI you should be able to add the env vars on the pulumi up command like
TASK=123 GROUP=test pulumi up