Azure / appservice-landing-zone-accelerator

The Azure App Service landing zone accelerator is an open-source collection of architectural guidance and reference implementation to accelerate deployment of Azure App Service at scale.
https://build.microsoft.com/en-US/sessions/58f92fab-3298-444d-b215-6b93219cd5d7?source=sessions
MIT License
200 stars 95 forks source link

Terraform Directory Structure Refactoring #189

Open JinLee794 opened 8 months ago

JinLee794 commented 8 months ago

Refactor the Terraform deployment scenario such that the scenario-specific deployments can be managed through feature flags provided by .tfvars files.

Current Structure:

|-- scenarios/
|   |-- secure-baseline-ase/terraform/
|   |   |-- Parameters/uat.tfvars
|   |   |-- main.tf
|   |   `-- ...
|   `-- secure-baseline-multitenant/terraform`/
|       |-- Hub/
|       |   |-- Parameters/uat.tfvars
|       |   |-- main.tf
|       |   `-- ...
|       `-- Spoke/
|           |-- Parameters/uat.tfvars
|           |-- main.tf
|           `-- ... 

Proposed Structure:

|-- terraform/
|   |-- ase/
|   |   |-- main.tf
|   |   `-- ...
|   |-- hub/
|   |   |-- main.tf
|   |   `-- ...
|   |-- spoke/
|   |   |-- main.tf
|   |   `-- ...
|   |-- scenarios/
|   |   |-- ase.tfvars
|   |   |-- ase-multi-tenant.tfvars
|   |   `-- multi-tenant.tfvars
|   |-- main.tf -> references the hub/ spoke/ ase/ deployments via flags
|   `-- ...
|-- bicep/
|   `-- ...
`-- shared/
    |-- modules/
    |   |-- terraform/
    |   `-- bicep/
    `-- scripts/

Main benefit of this structure is that we can reuse the existing deployment files, but consolidate everything under a single deployment - which helps ensure consistent deployments with less repeated work.