Base infrastructure is the foundational set of resources that other infrastructure resources require. In an infrastructure-as-code migration, networks commonly provide this foundation for servers, databases, load balancers, and firewalls. section 2.2.2
Migrate base infrastructure before dependent resources:
- Inventory the existing resources and identify their dependencies. section 2.2.2
- Reverse-engineer each network’s name and CIDR block from the provider API, then reproduce its actual state in code. section 2.2.2
- Import existing networks into the provisioning tool’s state when possible; otherwise recreate them or check for their existence conditionally. section 2.2.2
- Rerun the IaC and verify that no drift remains before migrating servers, databases, and other dependent resources. section 2.2.2
Development environment migration
A brownfield hello-world environment contains database and development networks, servers, load balancers, firewalls, and DNS entries. Encode the networks first, then migrate the server and database resources that depend on them. section 2.2.2
Figure 2.5 Reverse engineer the networks for the database and server first and write their configurations as code.
Shows how to reverse-engineer the database and server networks before writing their configurations as code. section 2.2.2
