Subchapter 27.48
references/phases/generate/generate-infra.mdMarkdown23 KBView on GitHub
Loaded by generate.md when estimation-infra.json exists.
Execute ALL steps in order. Do not skip or optimize.
Read the following artifacts from $MIGRATION_DIR/:
aws-design.json (REQUIRED) — AWS architecture design from Phase 3estimation-infra.json (REQUIRED) — Cost estimates from Phase 4gcp-resource-clusters.json (REQUIRED) — Cluster dependency graph 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.”
Before building the timeline, load
references/shared/migration-complexity.mdand classify the migration tier using inputs fromaws-design.json,gcp-resource-clusters.json,estimation-infra.json, andpreferences.json.
Build a timeline using the Infrastructure Path ranges for the determined tier. Also consider:
gcp-resource-clusters.json — more clusters = longer infrastructure phasecreation_order — deeper graphs need more sequential workaws-design.json — databases and stateful services take longerpreferences.json — maintenance window vs. blue-green affects timelineCompressed setup. PoC is a 2-day smoke test integrated into deployment. No data migration stage (small tier excludes databases by definition).
estimation-infra.json projectionspreferences.json cutover_strategyStandard phased plan. Apply the data-migration skip rule below.
creation_order_depth) to AWSestimation-infra.json projectionscreation_order sequence (depth-first)aws-design.json resource mappingsInclude this phase ONLY if aws-design.json contains database or storage resources
(see resource detection rules in generate-artifacts-scripts.md Step 1).
If no data migration is needed, drop that stage: Cutover
and Validation move up in sequence. Note the dropped stage as a duration driver.
gsutil/aws s3 sync for bulk transferpreferences.json cutover_strategy:
estimation-infra.json projectionsExtended timeline for complex migrations. Extra time for multi-cluster orchestration, large data volumes, and extended validation. Apply the data-migration skip rule from Stage 4.
Same as Medium.
Same as Medium.
Extended scope: additional clusters and complex cross-cluster networking.
creation_order sequence (depth-first)aws-design.json resource mappingsInclude this phase ONLY if aws-design.json contains database or storage resources.
If no data migration is needed, drop that stage: Cutover
and Validation move up in sequence. Note the dropped stage as a duration driver.
Extended for large data volumes and complex replication topologies.
gsutil/aws s3 sync for bulk transferSame structure as Medium.
Extended monitoring before GCP teardown.
estimation-infra.json projectionsBuild a risk matrix from the discovered infrastructure and migration complexity.
For each risk, assess:
"high" (>60%), "medium" (30-60%), "low" (<30%)"critical" (service outage), "high" (degraded service), "medium" (delayed timeline), "low" (minor inconvenience)| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Data loss during migration | low | critical | Dual-write for 2 weeks before cutover; full backup before migration; checksums on all transfers |
| Performance regression on AWS | medium | high | PoC testing before deployment; load testing before cutover; performance baseline comparison |
| Extended downtime during cutover | medium | high | Practice cutover in staging; automate DNS switch; rollback procedure on standby |
| Cost overrun vs estimates | medium | medium | Set billing alerts at 80% and 100% of projected; weekly cost review |
| Cross-region latency | low | medium | Validate latency in PoC phase; consider same-region deployment for latency-sensitive services |
| Terraform state corruption | low | high | Remote state with locking (S3 + DynamoDB); state backups before each apply |
Add additional risks based on discovered infrastructure:
google_bigquery_* or aws_service is Deferred — specialist engagement in aws-design.json): Add risk “BigQuery AWS target not yet selected” (severity medium, not high) with mitigation: “Engage AWS account team and/or data analytics migration partner to evaluate the best analytics migration path; does not block phased migration of compute, database, and AI. Plugin does not prescribe Athena/Redshift/Glue.”For each service in aws-design.json, define:
| Metric | Target | Measurement |
|---|---|---|
| Availability | 99.9% uptime | CloudWatch synthetic monitoring |
| Latency | Within 10% of GCP baseline | P50, P95, P99 response times |
| Error rate | < 0.1% | CloudWatch error metrics |
| Cost | Within 15% of estimation-infra.json projection | AWS Cost Explorer weekly |
| Metric | Target |
|---|---|
| Data integrity | 100% — zero data loss confirmed by checksums |
| Migration sequence | Stages complete in planned order; no stage entered before its go/no-go gate |
| Rollback success | Tested and confirmed < 1 hour RTO |
| Team confidence | Go/No-Go passed at each phase gate |
Initiate rollback if ANY of:
estimation-infra.json projections| Phase | Rollback Action | RTO |
|---|---|---|
| Setup (1-2) | Delete AWS resources; no impact | < 1 hour |
| PoC (3-4) | Tear down PoC cluster; GCP unaffected | < 1 hour |
| Infrastructure (5-7) | Tear down AWS clusters; GCP still primary | < 2 hours |
| Data Migration (8-9) | Stop replication; GCP data is authoritative | < 30 minutes |
| Cutover (10-11) | Reverse DNS to GCP; resume GCP traffic | < 1 hour |
| Post-Cutover (12+) | Manual restore from backup; GCP resources archived | 2-4 hours |
| Activity | Migration Lead | Infrastructure Engineer | Database Engineer | Application Developer | QA Engineer |
|---|---|---|---|---|---|
| Migration planning | A/R | C | C | C | I |
| AWS account setup | A | R | I | I | I |
| Network infrastructure | A | R | I | I | I |
| Database migration | A | C | R | I | C |
| Application deployment | A | C | I | R | C |
| Data validation | A | I | R | C | R |
| Performance testing | A | C | C | C | R |
| Cutover execution | R | R | R | C | C |
| Rollback execution | R | R | R | I | I |
R = Responsible, A = Accountable, C = Consulted, I = Informed
Each phase gate requires explicit approval before proceeding.
| Gate | Phase Transition | Go Criteria | No-Go Action |
|---|---|---|---|
| G1 | Setup → PoC | VPC online, IAM configured, connectivity verified | Fix infrastructure issues |
| G2 | PoC → Full Deploy | PoC cluster healthy, latency acceptable, costs tracking | Reassess architecture |
| G3 | Full Deploy → Data Migration | All clusters deployed, integration tests passing | Debug failing clusters |
| G4 | Data Migration → Cutover | Replication lag < 1s, data integrity confirmed, rollback tested | Fix replication issues |
| G5 | Cutover → Validation | DNS switched, traffic flowing, error rate < 0.1% | Execute rollback |
| G6 | Validation → Cleanup | 1 week stable operation, costs within 15% of estimate | Extend monitoring period |
Week 1 (Days 1-7): Intensive monitoring
Days 8-14: Stabilization
Days 15-30: Optimization
estimation-infra.jsonSTART: All clusters deployed?
NO → Continue infrastructure deployment
YES → Data replication active?
NO → Start data migration
YES → Replication lag < 1 second?
NO → Wait for replication to catch up
YES → All integration tests passing?
NO → Fix failing tests
YES → Rollback procedure tested?
NO → Execute rollback drill
YES → READY FOR CUTOVER
→ Execute cutover per strategy
→ Monitor 24-48 hours
→ Error rate < 0.1%?
NO → EXECUTE ROLLBACK
YES → CUTOVER SUCCESSFUL
→ Begin 30-day monitoring
→ Plan GCP teardown (after the 30-day observation window)Do NOT write engineering-hour estimates anywhere in this artifact — the plugin
has no calibrated effort data, and hour figures get pasted into budgets (see
shared/migration-complexity.md § Provenance). Time is expressed as the
ordered stage sequence plus duration_drivers[] (from the tier’s driver table,
adapted to this stack, binding driver first) and tier_bound_by (the input
that bound the tier). Do not count deferred/N/A services as drivers of
implementation work, and do not restate AI-track drivers already named by
generation-ai.json.
Generate generation-infra.json in $MIGRATION_DIR/ with the following schema:
{
"phase": "generate",
"generation_source": "infrastructure",
"complexity_tier": "medium",
"complexity_inputs": {
"service_count": 5,
"monthly_spend": 3500.00,
"has_databases": true,
"has_stateful_storage": false,
"has_ai_workloads": false,
"availability":
phase is "generate"generation_source is "infrastructure"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; migration_plan.tier_bound_by names the binding classification input; no total_weeks or hour fields anywhere in the artifactmigration_plan.phases array has at least 4 entries; stage names match the tier template from Part 1migration_plan.services covers every service from aws-design.jsonmigration_plan.critical_path is non-emptymigration_plan.dependencies reflect gcp-resource-clusters.json creation_orderrisks array has at least 3 entries with probability, impact, mitigationsuccess_metrics has both per_service and overall sectionsrollback_procedures has trigger conditions and RTO valuesgo_no_go_criteria has at least 2 gates (small) or 4 gates (medium/large)post_migration specifies monitoring duration and teardown timingrecommendation contains no effort-hour fields; duration is communicated only via stage sequence + duration_driversgcp-resource-clusters.jsonBefore returning control to generate.md, require:
generation-infra.json exists and passes the Output Validation Checklist above.If this gate fails: STOP and output: “generate-infra did not produce a valid generation-infra.json; do not continue Generate Stage 2.”
The parent orchestrator (generate.md) uses generation-infra.json to:
generate-artifacts-infra.md requires this filegenerate-artifacts-docs.md for MIGRATION_GUIDE.md.phase-status.json