aws-lambda-fleet-to-cloud-run
Skill1 starsChanged 4 months agoApache-2.0View on GitHub
Migrates large estates of AWS Lambda functions (10–100+ Lambdas in monorepos) to Google Cloud Run. Provides fleet-level discovery, grouping strategy (1:1 vs. consolidation), dependency-graph-based migration wave sequencing, and a consolidated Migration Program Document. Designed to complement the aws-lambda-to-cloud-run-migration skill for per-function deep analysis.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apigee-x-proxy-developmentSkill
- aws-lambda-to-cloud-run-migrationSkill
- preso-builderSkill
- visual-docsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
scripts/analyze_fleet.py: Run this first on the monorepo root. - Distinctive: line 52
Run the fleet analysis script against the monorepo root:
- Very specific: line 89
Run aws-lambda-to-cloud-run-migration/scripts/analyze_lambda.py <function_dir> (from the prerequisite per-function skill) for per-function …
- Distinctive: line 92
After each wave completes, update the Migration Program Document (see §Final Deliverable).
- Distinctive: line 98
If available in the user's environment:
- Distinctive: line 106
If information is missing, prompt the user:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Lambda Fleet → Google Cloud Run Migration Skill
This skill handles fleet-level migrations: multiple Lambda functions deployed from a monorepo or shared account. It discovers all functions across a repository, builds a dependency graph, groups them into Cloud Run services, and sequences migrations into waves.
[!IMPORTANT] Prerequisite Skill: This skill assumes
aws-lambda-to-cloud-run-migrationis also installed. That skill performs deep, per-function analysis (containerization, SDK refactoring, IaC translation). This skill calls into it for each migration wave. Never duplicate that skill's guidance here.
When to Use Which Skill
Positive Triggers
- Migrating large estates or monorepos containing 2+ AWS Lambda functions (10–100+ Lambdas).
- Fleet discovery, inventory generation (
analyze_fleet.py), and cross-function dependency graph analysis. - Grouping strategy (1:1 vs. domain consolidation into Cloud Run services) and migration wave sequencing.
- Producing a consolidated Migration Program Document for an entire AWS Lambda fleet.
Negative Triggers (When NOT to Use)
- Migrating a single AWS Lambda function in isolation -> Delegate to
aws-lambda-to-cloud-run-migration. - Detailed per-function Dockerfile containerization, SDK refactoring, or Terraform IaC translation -> Delegate to
aws-lambda-to-cloud-run-migration(called during wave execution).
| Scenario | Use |
| Single Lambda function to migrate | aws-lambda-to-cloud-run-migration |
| 2+ Lambdas, a monorepo, or a shared AWS account to migrate | This skill |
| Need per-function Dockerfile, IaC, or SDK refactoring detail | Delegate to aws-lambda-to-cloud-run-migration after grouping |
Available Resources
Load the following resources as needed during the workflow:
scripts/analyze_fleet.py: Run this first on the monorepo root. Recursively discovers all Lambda functions and producesfleet_manifest.json(function inventory + dependency edges). Use--summaryfor a human-readable terminal table. Read the JSON file immediately after running.references/fleet_strategy.md: Decision framework for grouping N Lambdas into M Cloud Run services. Covers 1:1, Domain Consolidation, and Sidecar/Platform patterns with a scored decision matrix.references/dependency_graph.md: How to readdependency_edgesfrom the fleet manifest, apply topological sort to define migration waves, and maintain a cross-cloud invocation bridge during the transition window.references/consolidation_patterns.md: Step-by-step mechanics for merging multiple Lambda handlers into a single Cloud Run service (Router Pattern, Handler-as-Module, shared initialization).
3-Phase Fleet Migration Workflow
Phase 1 — Fleet Discovery
Goal: Build a complete inventory of all Lambdas and their relationships.
- Run the fleet analysis script against the monorepo root:
python scripts/analyze_fleet.py <repo_root> --output <output_dir> --summary - Read
fleet_manifest.jsonimmediately. Focus on:fleet_summary: total function count, runtime distribution, trigger type breakdown.functions[]: per-function details (name, runtime, memory, timeout, triggers, layers, VPC).dependency_edges[]: directed edges showing which functions invoke or share resources with others.
- Present the user with the fleet summary table before proceeding.
Phase 2 — Grouping & Sequencing
Goal: Decide which Lambdas become which Cloud Run services, and in what order to migrate them.
- Load
references/fleet_strategy.mdand apply the decision matrix to each function or domain group. - Propose a grouping to the user. For each proposed Cloud Run service, state:
- Which Lambda(s) it replaces
- The chosen pattern (1:1, Domain Consolidation, or Sidecar)
- The rationale (ownership, runtime, scaling, shared state)
- Load
references/dependency_graph.mdand perform the topological sort ondependency_edges. Propose Migration Waves — leaf functions (no outbound dependencies) migrate first. Present the wave plan as a table:
Wave Lambda(s) Target Cloud Run Service Pattern Rationale 1 FnA,FnBsvc-ordersDomain Consolidation Same data store, same IAM 2 FnCsvc-notifications1:1 Independent scaling need 3 FnDjob-reconcile1:1 (Job) EventBridge cron → Cloud Run Job - Confirm the wave plan with the user before proceeding to Phase 3.
Phase 3 — Per-Function Migration (Wave Execution)
Goal: Migrate each wave using the existing per-function skill.
For each wave:
- If consolidating multiple Lambdas: Load
references/consolidation_patterns.mdand apply the Router or Handler-as-Module pattern to produce a single containerized service. - For each function in the wave: Invoke the
aws-lambda-to-cloud-run-migrationskill workflow:- Run
aws-lambda-to-cloud-run-migration/scripts/analyze_lambda.py <function_dir>(from the prerequisite per-function skill) for per-function depth. - Apply containerization, SDK refactoring, IaC translation as directed by that skill.
- Run
- Cross-wave bridge: While migrating a wave, consult
references/dependency_graph.md§4 to keep already-migrated services and not-yet-migrated Lambdas talking to each other. - After each wave completes, update the Migration Program Document (see §Final Deliverable).
Recommended External Tools
If available in the user's environment:
- AWS Documentation Tools (
mcp_aws-docs_*): Usesearch_documentationto look up Lambda event source mapping, Step Functions ASL, or EventBridge rule schemas that affect dependency detection. - Google Developer Knowledge Tools (
mcp_developer-knowledge_*): Usesearch_documentsto find Cloud Run service naming conventions, traffic splitting, and multi-service architectures.
Interactive Guidance
If information is missing, prompt the user:
- "Can you share the monorepo root path or a zip of the project so I can run
analyze_fleet.py?" - "Do any of these Lambdas share a DynamoDB table, SNS topic, or SQS queue? If so, which ones?"
- "Are different Lambda functions owned by different teams? That's a strong signal for 1:1 migration over consolidation."
- "Does your organization prefer Terraform (Path A) or scripted
gcloud run deploy(Path B) for the resulting IaC? (→ delegate toaws-lambda-to-cloud-run-migrationreferences/iac_translation.mdfor details)"
Final Deliverable: Migration Program Document
Produce a Migration Program Document (markdown) containing:
- Fleet Inventory Table — All discovered functions with runtime, trigger type, memory, and migration complexity rating (Low/Medium/High).
- Dependency Graph Summary — List of
dependency_edgeswith a plain-English description of each relationship. - Grouping Decision — For each proposed Cloud Run service: which Lambdas it replaces, chosen pattern, and rationale.
- Wave Plan — The sequenced migration table (Wave → Functions → Cloud Run Service → Pattern → Rationale).
- Cross-Cloud Bridge Notes — Any temporary bridge patterns needed during transition (Lambda calling Cloud Run, or vice versa).
- Per-Function Migration Links — For each function, a pointer to its individual migration report (produced by
aws-lambda-to-cloud-run-migration).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

