Open justin808 opened 6 months ago
After discussion with @borela we came up this first task that we can work on:
Why? User wants to use terraform to deploy application using CPLN as a provider
Goal
Create Terraform config files from existing YAML configuration files in .controlplane
folder
Before
controlplane/
├─ templates/
│ ├─ app.yml -- GVC config
│ ├─ postgres.yml -- workload config
│ ├─ rails.yml -- worload config
├─ controlplane.yml -- configs for overall application
├─ Dockerfile
├─ entrypoint.sh
After (generated files may change)
.controlplane/
├─ templates/
│ ├─ app.yml -- GVC config
│ ├─ postgres.yml -- workload config
│ ├─ rails.yml -- worload config
├─ terraform/
│ ├─ app.tf -- GVC config in HCL
│ ├─ postgres.tf -- Postgres workload config in HCL
│ ├─ rails.tf -- Rails worload config in HCL
│ ├─ providers.tf -- CPLN provider config in HCL
│ ├─ variables.tf -- Variables config in HCL
│ ├─ loacals.tf -- Local variables config in HCL
├─ controlplane.yml -- configs for overall application
├─ Dockerfile
├─ entrypoint.sh
Task
Add cpflow terraform generate
command which transforms existing controlplane configs in YAML format to Terraform configs in HCL format and saves them in .controlplane/terraform
folder
.controlplane/templates
dir, support a.controlplane/terraform
dir and enable commands to use those.