Skip to content

feat: add delete_lambda() to remove a function's AWS resources - #41

Merged
novica merged 4 commits into
mainfrom
feat--delete-lambda
Oct 17, 2026
Merged

novica merged 4 commits into
mainfrom
feat--delete-lambda

Conversation

@novica

@novica novica commented Oct 17, 2026

Copy link
Copy Markdown
Member

Adds delete_lambda(tag, keep_ecr_image = FALSE, keep_local_image = FALSE), which removes what build_lambda(), deploy_lambda() and schedule_lambda() created for a tag:

  1. the function's EventBridge schedules (a rule is deleted only if it is a schedule_rule_* rule with no other targets left),
  2. the Lambda function,
  3. execution roles named <tag>--<uuid>, including ones left by failed deploys; a role passed as role_arn = is never touched,
  4. the ECR repository and its images, unless keep_ecr_image = TRUE,
  5. the /aws/lambda/<tag> log group,
  6. the local Docker image, unless keep_local_image = TRUE.

Missing resources are skipped, so it also cleans up after a partial deploy; other AWS errors stop it. The README gets a "Clean up" section.

Also adds dev/smoke-test.R (excluded from the build), a manual end-to-end check against a real AWS account: build, local test, deploy, invoke, schedule, then delete_lambda() and a check that nothing is left. The schedule step exercises the target ID fix in #40, so run it after that is merged.

Tests mock every AWS call. Neither delete_lambda() nor the smoke test has been run against AWS yet.

Assisted-by: Claude Code

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
A manual check against a real account before releases; it does not ship
with the package.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@novica
novica force-pushed the feat--delete-lambda branch from 8fe48ac to c394d68 Compare October 17, 2026 13:46
@novica
novica merged commit 13abc85 into main Oct 17, 2026
6 checks passed
@novica
novica deleted the feat--delete-lambda branch October 17, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant