Skip to content

chore(terraform): update terraform modules to latest standards#123

Closed
jansdhillon wants to merge 1 commit intomainfrom
charmkeeper/terraform
Closed

chore(terraform): update terraform modules to latest standards#123
jansdhillon wants to merge 1 commit intomainfrom
charmkeeper/terraform

Conversation

@jansdhillon
Copy link
Copy Markdown
Contributor

Summary

This PR aligns the Terraform modules with the team's latest standards.

Changes

  • terraform/charm/versions.tf: Updated required_version from >= 1.10 to ~> 1.12 and juju provider to ~> 1.0
  • terraform/product/modules/landscape-scalable/versions.tf: Same version updates
  • terraform/.tflint.hcl: Added tflint config at terraform root with terraform_required_version rule enabled (as per standard)
  • renovate.json: Added with charmhub custom datasource for automated terraform revision tracking (renovate will auto-update charm revision numbers in .tftest.hcl files)
  • terraform/charm/tests/main.tftest.hcl and terraform/charm/tests/setup/main.tf: Added integration test setup for the charm module
  • terraform/product/modules/landscape-scalable/tests/main.tftest.hcl and tests/setup/main.tf`: Added integration test setup for the product module
  • terraform/charm/outputs.tf: Fixed copyright year typo (2026 → 2025)
  • terraform/charm/README.md and product README: Updated version constraint in auto-generated docs section

Missing (requires workflow scope on token)

The following file could not be pushed due to token permission limitations and needs to be added manually:

.github/workflows/test_terraform_modules.yaml:

# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

name: Terraform modules tests

on:
  workflow_dispatch:
  pull_request:
    paths:
      - 'terraform/**'

jobs:
  terraform-tests:
    uses: canonical/operator-workflows/.github/workflows/terraform_modules_test.yaml@main
    secrets: inherit
    with:
      lxd-controller: true
      terraform-directories: '["terraform/charm", "terraform/product/modules/landscape-scalable"]'

Testing

All mock-provider terraform tests pass:

Success! 16 passed, 0 failed.

This PR was opened by the charmkeeper agent.

- Update required_version to ~> 1.12 and juju provider to ~> 1.0
- Add terraform/.tflint.hcl at the terraform root with required_version rule
- Add renovate.json with charmhub custom datasource for automated revision tracking
- Add tftest setup modules for charm and product modules
- Fix copyright year typo in outputs.tf (2026 -> 2025)
- Update README docs sections to reflect new version constraints

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jansdhillon
Copy link
Copy Markdown
Contributor Author

Closing in favor of PR #124 which includes all the same changes plus fixes. The branch charmkeeper/terraform is protected by a ruleset requiring PRs, so the fixes could not be pushed directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant