full-artist-27215
10/25/2021, 3:44 PMpulumi.Config()
inside a Dynamic Provider implementation? I've tried this in both Python and TypeScript, and whenever I try to get something from the config, I get this error:
error: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
billowy-army-68599
10/25/2021, 3:46 PMpulumi.Config
in your main program and pass it in from therefull-artist-27215
10/25/2021, 3:46 PMbillowy-army-68599
10/25/2021, 3:48 PMfull-artist-27215
10/25/2021, 3:50 PMbillowy-army-68599
10/25/2021, 5:07 PMexport interface MyAppArgs {
configItem: string
}
export interface MyApp {
// do some stuff here
const foo= args.configItem
}
if you follow this pattern, you can let the user decided if they want to set the configred-match-15116
10/25/2021, 5:10 PMbillowy-army-68599
10/25/2021, 5:14 PMfull-artist-27215
10/25/2021, 5:21 PMaws:region
on every AWS resource I want to create. What's the distinction that I'm missing?red-match-15116
10/26/2021, 3:57 PMfull-artist-27215
10/26/2021, 4:33 PMred-match-15116
10/26/2021, 5:10 PMRight, but I still don’t need to set the region as an input to any specific resource.But you do need to set it as an input to the provider which itself is an input to each resource.
full-artist-27215
10/26/2021, 10:13 PMpulumi.Config().require("vault:address")
anywhere in my program (dynamic resource implementation or otherwise), without it trying to look for it in my-project:vault:address
.
Is there a better way to try and approach this? Do I need to eschew the default Vault provider entirely, specify the relevant configuration parameters in my project's own namespace, create the provider in my code, and then manually pass that provider into every resource?red-match-15116
10/26/2021, 11:09 PMpulumi.Config("vault").require("address")
?cfg = pulumi.Config("aws")
region = cfg.require("region")
So I wonder if the namespaced config is what you’re missingfull-artist-27215
10/27/2021, 2:04 PM