Delete a Lambda function and the AWS resources created for it
Source:R/lambda-deploy.R
delete_lambda.RdRemoves what `build_lambda()`, `deploy_lambda()` and `schedule_lambda()` created for `tag`: the function's EventBridge schedules, the function, its execution roles, the ECR repository with its images, the function's CloudWatch log group, and the local Docker image. Resources that don't exist are skipped, so it also cleans up after a failed deploy.
Details
Only roles `deploy_lambda()` created for `tag` in the current region are deleted, and only when no Lambda function in the region still uses them. A role passed to `deploy_lambda(role_arn = )` is kept. A schedule rule that also targets other resources is kept, without this function as a target.