sparse-intern-71089
08/08/2018, 8:46 PMwhite-balloon-205
stocky-spoon-28903
08/08/2018, 8:57 PMwhite-balloon-205
aws-sdk
2. Using aws.lambda.getLambdaInvocation
(somewhat poorly named)
3. Embedding the Lambda inside something which runs during deployment, such as a nested aws.cloudformation.Stack
which includes a reference to a Pulumi Lambda as a custom resource.stocky-spoon-28903
08/08/2018, 9:07 PMgetLambdaInvocation
existed, that’s likely the simplest.stocky-spoon-28903
08/08/2018, 9:08 PMwhite-balloon-205
white-balloon-205
stocky-spoon-28903
08/08/2018, 9:20 PMstocky-spoon-28903
08/08/2018, 9:22 PMstocky-spoon-28903
08/08/2018, 9:23 PMif (!inputs.suppressFirstInvoke) {
certFunction.name.apply(async (functionName) => {
await aws.lambda.getInvocation({
functionName: functionName,
input: JSON.stringify({}),
qualifier: "$LATEST",
});
});
}
stocky-spoon-28903
08/08/2018, 9:24 PMstocky-spoon-28903
08/08/2018, 9:26 PMwhite-balloon-205
.apply
to ensure it only runs when the inputs are known.
However, I believe that will still run during previews after the initial update but against the old values.
We have plans to allow hooking explicit lifecycle events with callbacks - which is what you would likely really want here.
I think there is technically an ability to check if you are in preview - in general that shouldn't be necessary - but for now it might be required for this scenario: pulumi.runtime.isDryRun
.stocky-spoon-28903
08/08/2018, 10:00 PMpulumi.all([certFunction.name, certFunction.id]) => ....)
to ensure it didn’t actually run until it existed.stocky-spoon-28903
08/08/2018, 10:01 PMcreate
callback would be ideal though.white-balloon-205
stocky-spoon-28903
08/08/2018, 10:03 PMwhite-balloon-205