sparse-intern-71089
09/27/2023, 11:45 AMfast-sandwich-30809
09/27/2023, 1:59 PMbland-pharmacist-96854
09/27/2023, 2:01 PMbland-pharmacist-96854
09/27/2023, 3:29 PMbland-pharmacist-96854
09/27/2023, 3:30 PMpulumi.Config()
🤔fast-sandwich-30809
09/27/2023, 3:31 PMfast-sandwich-30809
09/27/2023, 3:33 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.bland-pharmacist-96854
09/27/2023, 3:58 PMfast-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 PMlittle-cartoon-10569
09/27/2023, 7:30 PM