alert-gpu-18471
11/21/2022, 2:38 PMpulumi.Output
has been bugging me. The function works if I put raw string in the code, but, not with pulumi.interpolate
.
I will provide some code in comment for the context!
Thank you in advance. 🙇♂️🏻const ogimGlueCrawler = new aws.glue.Crawler("ogim-report-crawler", {
databaseName: glueCatalogDatabase.name,
role: monitoringRoleArn,
s3Targets: [{
path: pulumi.interpolate`s3://${bucketName}/ogim`,
}],
});
const pythonLambda = new aws.lambda.Function("python-lambda-function", {
code: new pulumi.asset.AssetArchive({
".": new pulumi.asset.FileArchive("./lambda"),
}),
runtime: aws.lambda.Python3d8Runtime,
timeout: 30,
handler: "handler.glue_handler",
role: lambdaRole.arn
});
const glueLambdaInvocation = new aws.lambda.Invocation("python-lambada-invocation", {
functionName: pulumi.interpolate`${pythonLambda.name}`,
input: JSON.stringify({
crawler_name: pulumi.interpolate`${ogimGlueCrawler.name}`,
dummy_number: Math.floor(Math.random() * 1000), // To force lambda to run
}),
});
little-cartoon-10569
11/21/2022, 6:43 PMinput
. You can't set input
to be a string, then embed an output into the string. That will just call toString()
on the output, which isn't what you want.apply
originGlueCrawler.name, and build the JSON string in there. That way, the output will contain JSON, input
can decide outputs, and the JSON gets correctly put into the payload.alert-gpu-18471
11/22/2022, 3:20 AM