in aws-lambda-function-resolvers/src/main/java/jetbrains/buildServer/runner/lambda/function/LambdaFunctionResolverEx.kt [17:44]
override fun resolveFunction(): String {
val getFunctionRequest = GetFunctionRequest().apply {
functionName = lambdaFunctionName
}
try {
logger.message("Checking if function $lambdaFunctionName already exists...")
val function = awsLambda.getFunction(getFunctionRequest)
logger.message("Function $lambdaFunctionName already exists, checking if configuration is updated...")
if (doesFunctionConfigurationNeedUpdate(function)) {
updateFunctionConfiguration(lambdaFunctionName)
}
if (doesFunctionNeedUpdate(function)) {
updateFunction()
}
} catch (e: ResourceNotFoundException) {
createFunction(lambdaFunctionName)
} catch (e: AWSLambdaException) {
// Should the function be executed locally, a 404 will happen
if (e.statusCode != 404) {
throw e
}
}
return lambdaFunctionName
}