breaking(terraform-server): update terraform module to match Canonical Spec#1007
breaking(terraform-server): update terraform module to match Canonical Spec#1007rene-oromtz wants to merge 6 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1007 +/- ##
==========================================
+ Coverage 75.24% 75.32% +0.08%
==========================================
Files 110 111 +1
Lines 10757 10988 +231
Branches 898 927 +29
==========================================
+ Hits 8094 8277 +183
- Misses 2467 2502 +35
- Partials 196 209 +13
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the server/terraform module to match a Canonical Terraform module “spec” style interface (explicit model_uuid, generic config, etc.), updates the Juju Terraform provider requirement, and adds supporting documentation + automation for module version tagging.
Changes:
- Reworked the server module inputs to a smaller “canonical” surface (
app_name,model_uuid,config, etc.) and simplified the deployment resources. - Added module outputs (
application,provides,requires) plus adev/higher-level example for local deployment. - Added a GitHub Actions workflow to auto-tag module versions based on commit semantics.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
server/terraform/variables.tf |
Replaces environment-driven inputs with canonical module inputs (model_uuid, config, etc.). |
server/terraform/main.tf |
Simplifies to a single juju_application for the server charm using the new inputs. |
server/terraform/outputs.tf |
Introduces module outputs for application object and integration endpoint maps. |
server/terraform/terraform.tf |
Bumps required Juju provider version constraint to ~> 1.0. |
server/terraform/README.md |
Replaces local deployment instructions with module API/usage documentation. |
server/terraform/CONTRIBUTING.md |
Adds module-specific contribution and local deployment guidance. |
server/terraform/dev/main.tf |
Adds a higher-level dev example wiring ingress + MongoDB offer integration. |
server/terraform/dev/variables.tf |
Adds dev-only variables for secrets used in the example. |
server/terraform/dev/terraform.tf |
Pins dev example to Juju provider ~> 1.0. |
server/terraform/dev/cloud-init.yaml |
Updates MongoDB charm channel used in dev bootstrap steps. |
server/terraform/dev/.gitignore |
Adds .terraform.lock.hcl and standard Terraform ignores for dev. |
.github/workflows/server-terraform-tags.yml |
Adds auto-tagging workflow for the server Terraform module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1ed4eff to
11eecb2
Compare
Description
This PR updates the terraform files for server module aligning with the standards defined in CC008 specification.
Changes introduced:
README.md: updated to be aligned with the requirements in Spec including variables, inputs and outputs.main.tf: modify file to include required variables, including usingmodel_uuidinstead ofmodel name.providers.tf: Empty file just for matching spec requirementsterraform.tf: renamedversions.tftoterraform.tfas required by spec. It also includes the use of "any" Terraform provider in 1.x version as all charm modules should be above 1.0.0 version.output.tf: included application, provides and requires from charm application.variables.tf: This includes all the required variables in alphabetical orderlocals.tf: Empty file just for matching spec requirementsCONTRIBUTING.md: Updated with instruction on how to deploy server locally via Terraformterraform/devdirectory added as well for simplifying local testing.Resolved issues
Resolves CERTTF-896
Documentation
Updated
CONTRIBUTING.mdandREADME.mdfor Terraform moduleWeb service API changes
Tests
Tested locally to deploy a fresh installation following
CONTRIBUTING.md:Additionally, tested on staging via this run
Some migrations needs to be performed but this on deployment side and not on this module, what is important is that no modification are made: