sparse-intern-71089
06/23/2020, 6:58 PMsticky-kitchen-61063
06/23/2020, 7:03 PMhundreds-musician-51496
06/23/2020, 7:14 PMpulumi.Config()
on its own quickly gets unwieldy. So for example I have a config like so:
export interface ConfigSettings {
ssmParameterName: string
subdomain?: string
tld: TLD
docsDir: string
}
and then I load it in a function that provides reasonable defaults:
function getConfig(): ConfigSettings {
const config = new pulumi.Config("deploy"),
ssmParameterName = config.require<string>("docsDeployParam"),
tld = config.get<TLD>("tld") || "dev",
subdomain = config.get("subdomain"),
docsDir = config.get("docsDir") || "../content/build"
return { ssmParameterName, tld, subdomain, docsDir }
}
And the rest of my program is only aware of my local getConfig
and ConfigSettings
definitions.sticky-kitchen-61063
06/23/2020, 8:34 PM