Subchapter 27.47
references/phases/generate/generate-billing.mdMarkdown17 KBView on GitHub
Loaded by generate.md when estimation-billing.json exists.
Execute ALL steps in order. Do not skip or optimize.
Known limitations: Partial IaC discovery (mixed Terraform + billing-only services) is not yet supported. Confidence scoring per service based on billing SKU specificity is not yet implemented.
This file produces a complexity-scaled migration plan with wider timelines and lower confidence thresholds than the infrastructure path. Billing-only data provides service-level spend but lacks configuration details (instance sizes, replication settings, networking topology). The plan accounts for this uncertainty with:
Read the following artifacts from $MIGRATION_DIR/:
aws-design-billing.json (REQUIRED) — Billing-based service mapping from Phase 3estimation-billing.json (REQUIRED) — Billing-only cost estimates from Phase 4billing-profile.json (REQUIRED) — GCP billing breakdown from Phase 1preferences.json (REQUIRED) — User migration preferences from Phase 2If any required file is missing: STOP. Output: “Missing required artifact: [filename]. Complete the prior phase that produces it.”
For a more accurate migration plan, provide Terraform files and re-run discovery. This billing-only plan is suitable for initial budgeting and stakeholder discussions, but must be refined with IaC discovery before executing the actual migration.
Before building the timeline, load
references/shared/migration-complexity.mdand classify the migration tier using the inputs fromaws-design-billing.json,billing-profile.json, andpreferences.json.
Use the Billing-Only Path stage templates from migration-complexity.md for the determined tier. The three tiers produce different timelines:
No parallel-run stage. Discovery and provisioning overlap. Suitable for migrations with <=3 services, <$1K/month, no databases, single-AZ, no compliance.
Shortened parallel run. Discovery takes 1-2 weeks instead of 4. For migrations with 4-8 services, $1K-$10K/month, or databases present.
Full conservative plan with extended discovery and parallel-run phases. For migrations with 9+ services, >$10K/month, multi-region, compliance, or AI alongside infrastructure.
Risks are scaled by complexity tier. Use the Risk Scaling by Tier table in references/shared/migration-complexity.md to set probability values. The table below shows risk templates — replace the probability column with the tier-appropriate value.
| Risk | Small Prob. | Medium Prob. | Large Prob. | Impact | Mitigation |
|---|---|---|---|---|---|
| Incorrect service sizing | low | medium | high | high | Discovery phase audit; right-size after validation |
| Missing dependencies discovered late | low | medium | high | medium | Manual dependency mapping in discovery; buffer in timeline |
| Data migration complexity underestimated | n/a | medium | high | high | Dry run before cutover; parallel run as safety net (medium/large only) |
| Cost overrun due to unknown configurations | low | medium | high | medium | Set billing alerts at 80% of high estimate; weekly cost reviews |
| Performance regression from incorrect sizing | low | medium | medium | high | Parallel run comparison (medium/large); resize before cutover |
| Longer timeline than planned | low | medium | high | medium | Build buffer into schedule; communicate planned timeline upfront |
| Unmapped services block migration | low | medium | medium | high | Address unknowns in discovery refinement |
| BigQuery migration complexity (if BigQuery in billing) | high | high | high | high | Engage AWS account team for specialist guidance on query patterns, data volumes, ETL pipelines, and BI integrations |
For the determined tier, include only risks with probability > “n/a”. Use the probability from that tier’s column.
For each service in aws-design-billing.json.services[], generate a migration step template.
Service: [gcp_service] → [aws_service]
Monthly Cost: $[monthly_cost] (GCP) → $[aws_mid] estimated (AWS)
How chosen: Estimated from billing only (JSON: billing_inferred) — see design-refs/fast-path.md User-facing vocabulary
Steps:
1. [ ] Determine actual configuration (instance size, storage, etc.)
- TODO: Check GCP console or Terraform for [gcp_service] configuration
2. [ ] Provision AWS [aws_service] with discovered configuration
3. [ ] Migrate data (if applicable)
4. [ ] Test functionality and performance
5. [ ] Validate cost aligns with estimate
Unknowns:
- Instance sizing: TODO — verify in GCP console
- Scaling configuration: TODO — verify current autoscaling policies
- Dependencies: TODO — map which services depend on this oneService: Cloud Run → Fargate
Monthly Cost: $450.00 (GCP) → $270-$630 estimated (AWS)
How chosen: Estimated from billing only (JSON: billing_inferred)
SKU Hints: CPU Allocation Time, Memory Allocation Time
Steps:
1. [ ] Determine actual configuration
- TODO: Check CPU/memory allocation per Cloud Run service
- TODO: Check concurrency and scaling settings
- TODO: Check number of Cloud Run services
2. [ ] Create Fargate task definitions with matching CPU/memory
3. [ ] Set up ALB and target groups
4. [ ] Deploy container images to ECR
5. [ ] Configure autoscaling to match Cloud Run behavior
6. [ ] Test endpoint connectivity and performance
Unknowns:
- CPU allocation: TODO — check Cloud Run service configurations
- Memory allocation: TODO — check Cloud Run service configurations
- Number of services: TODO — count from GCP console or gcloud CLI
- Concurrency settings: TODO — check Cloud Run concurrency limitsFor each entry in aws-design-billing.json.unknowns[]:
Service: [gcp_service] — UNMAPPED
Monthly Cost: $[monthly_cost] (GCP)
Reason: [reason]
Suggestion: [suggestion]
Action Required:
- [ ] TODO: Manually identify the AWS equivalent for [gcp_service]
- [ ] TODO: Determine configuration and sizing
- [ ] TODO: Add to migration plan once mappedThresholds scaled by complexity tier. Simpler migrations have fewer unknowns and tighter targets. Use the Success Criteria Scaling by Tier > Billing-Only Path table in references/shared/migration-complexity.md.
| Criteria | Small | Medium | Large |
|---|---|---|---|
| Performance within baseline | Within 15% of GCP | Within 20% of GCP | Within 20% of GCP |
| Monitoring stability | 24-hour watch period | 48-hour watch period | 48-hour watch period |
| Post-migration stability | 14-day observation | 30-day observation | 45-day observation |
| Cost variance | Within 25% of mid estimate | Within 30% of mid estimate | Within 40% of mid estimate |
| Data integrity | 100% | 100% | 100% |
| Service availability | 99% | 99% | 99% |
Apply the column matching the determined complexity tier.
Generate generation-billing.json in $MIGRATION_DIR/ with the following schema.
The example below shows a small tier migration. Adjust complexity_tier, complexity_inputs, duration_drivers, tier_bound_by, approach, phases, risk probabilities, and success metric thresholds according to the determined tier (see Part 2, Part 3, Part 5, and references/shared/migration-complexity.md).
{
"phase": "generate",
"generation_source": "billing_only",
"confidence": "low",
"complexity_tier": "small",
"complexity_inputs": {
"service_count": 2,
"monthly_spend": 75.71,
"has_databases": false,
"has_stateful_storage": false,
"has_ai_workloads": false,
"availability": "single-az",
"compliance": "none",
"multi_region": false
},
"timestamp": "2026-02-26T14:30:00Z",
"migration_plan": {
"duration_drivers": [
"Few services, no databases (binding: service_count <= 3)",
"Billing-only discovery gap - configs audited during Stage 1"
],
"tier_bound_by": "service_count <= 3",
"approach": "compressed",
"phases": [
{
"name": "Discovery + Provisioning",
"sequence_note": "ordinal - see stage order",
"key_activities": [
"Quick infrastructure audit",
"AWS provisioning",
"IAM and security configuration"
]
},
{
"name": "Deploy + Test",
"sequence_note": "ordinal - see stage order",
"key_activities": [
"Application deployment",
"Functional and integration testing",
"Cost validation"
]
},
{
"name": "Cutover + Validation",
"sequence_note": "ordinal - see stage order",
"key_activities": [
"DNS switch during maintenance window",
"24-hour intensive monitoring",
"Stabilization and GCP teardown planning"
]
}
],
"services": [
{
"gcp_service": "Compute Engine",
"aws_service": "EC2",
"monthly_cost_gcp": 75.46,
"estimated_cost_aws_mid": 75.46,
"confidence": "billing_inferred",
"human_expertise_required": false,
"unknowns": ["instance sizing", "scaling config"]
}
]
},
"risks": [
{
"category": "incorrect_sizing",
"probability": "low",
"impact": "high",
"mitigation": "Discovery audit; right-size after validation",
"phase_affected": "Discovery + Provisioning"
}
],
"success_metrics": {
"performance_threshold": "within 15% of GCP baseline",
"monitoring_period_hours": 24,
"stability_period_days": 14,
"cost_variance_threshold": "within 25% of mid estimate",
"data_integrity": "100%",
"availability_target": "99%"
},
"recommendation": {
"approach": "Compressed migration",
"confidence": "low",
"iac_discovery_offered": true,
"note": "For tighter estimates and a shorter timeline, provide Terraform files and re-run discovery.",
"key_risks": [
"Configuration uncertainty",
"Missing dependency information",
"Cost variance due to unknown sizing"
]
}
}phase is "generate"generation_source is "billing_only"confidence is "low"complexity_tier is one of "small", "medium", "large"complexity_inputs object is present with all required fields (service_count, monthly_spend, has_databases, has_stateful_storage, has_ai_workloads, availability, compliance, multi_region)migration_plan.duration_drivers is a non-empty string array consistent with the tier’s driver table; tier_bound_by present; no total_weeks or hour fieldsmigration_plan.approach matches tier: small = "compressed", medium = "standard_with_discovery", large = "conservative_with_discovery"migration_plan.phases stage names match the tier template from Part 2migration_plan.services covers every service from aws-design-billing.jsonrisks array has at least 2 entries (small), 4 entries (medium), or 5 entries (large)probability matches the tier column from Part 3success_metrics thresholds match the tier column from Part 5recommendation.iac_discovery_offered is truerecommendation.confidence is "low"recommendation contains no effort-hour fieldsBefore returning control to generate.md, require:
generation-billing.json exists and passes the Output Validation Checklist above.If this gate fails: STOP and output: “generate-billing did not produce a valid generation-billing.json; do not continue Generate Stage 2.”
The parent orchestrator (generate.md) uses generation-billing.json to:
generate-artifacts-billing.md requires this filegenerate-artifacts-docs.md for MIGRATION_GUIDE.md.phase-status.json