bland-pharmacist-96854
09/27/2023, 11:45 AMUpOptions
from the called program? Or pass some data to the program?fast-sandwich-30809
09/27/2023, 1:59 PMbland-pharmacist-96854
09/27/2023, 2:01 PMpulumi.Config()
🤔fast-sandwich-30809
09/27/2023, 3:31 PMconst program = (accountId: string) => {doTheThing()};
const makeProgram = (accountId: string) => () => program(accountId);
const myNowCustomizedProgram = makeProgram("1234");
pulumiDriver(myNowCustomizedProgram);
bland-pharmacist-96854
09/27/2023, 3:58 PMmain
method of the index.ts of the pulumi project.
I import it into another pulumi file where I pass it into the program parameter, like program: main
This works well.fast-sandwich-30809
09/27/2023, 4:29 PM// --- In ./project/index.ts ---
// The main function may take arguments!
export function main(accountId, comment){
// Code goes here
}
// --- In the file putting it all together ---
import {main} from './project/index.ts';
var accountId = getAccountId(); // Get parameters however you need
function wrappedMain(){
main(accountId, "Pass other parameters here");
}
pulumi.up({
program: wrappedMain, // Pulumi doesn't need to know that main is wrapped ;)
});
little-cartoon-10569
09/27/2023, 7:29 PM