Is there a way to get the “asset” reference from a...
# help
d
Is there a way to get the “asset” reference from an
sst.Api > Function
api.getFunction(‘ANY /’) gives me the function
but not sure how I can then get the asset reference…. would like to use it like this…
Copy code
const updaterCR = this.createLambdaCodeReplacer(name, asset)
fn.node.addDependency(updaterCR)
and pass the asset into it
this does not seem to work although I’m sure this logic is wrong…
Copy code
const functionAsset = handlerFunction.node.root.functionAsset as s3Assets.Asset
Ok this lints ok… but not sure if its going to work…
Copy code
const functionAsset = handlerFunction.node.findChild('Code') as s3Assets.Asset