Hm. I have a module that creates and AWS cloudfront with an edge lambda. All good and well, the problem is that on creation of the cloudfront I need to construct a reference to the edge lambda which is the arn plus the number of the last published version. In other words, I need somehow to get the arn and the version AFTER the lambda has been created. How do I do that? As it is, after running “lambda = new aws.lambda.function(…” all I get when I try to make a new arn out of “newarn = lambda.arn + ‘:’ + lambda.version” is a message about using apply, which doesn’t work.
In general this is a problem, i.e. serializing execution here and there, waiting for a specific resource to be created before proceeding. I am sure there’s a general solution to this… or?