skills/seb4stien/charmkeeper/charmkeeper-terraform

charmkeeper-terraform

SKILL.md

Plan:

  • Find the terraform modules in the repository.
  • Ensure each terraform module is following the implementation standards.
  • Run the tests to ensure the modules work as expected.

Implementation standards

  • Expected versions:

    • terraform: ~> 1.12
    • juju provider: ~> 1.0
  • The module should only have a "model_uuid" variable, no "model" variable.

  • Lint terraform modules with terraform fmt --recursive and tflint --recursive (fix the errors and the warnings).

Testing

Writing terraform tests

Local testing

The terraform tests should be run in a virtual machine named "charmkeeper".

If the machine doesn't exist, create it with: scripts/create-charmkeeper-vm.sh.

If not already done, mount the working directory folder in the machine with

multipass mount --type native $PWD charmkeeper:/workdir

For each TERRAFORM_MODULE

multipass exec charmkeeper -d /workdir/$TERRAFORM_MODULE -- terraform init
multipass exec charmkeeper -d /workdir/$TERRAFORM_MODULE -- terraform test

CI testing

This workflow is the reference to use to implement or update CI tests: https://raw.githubusercontent.com/canonical/platform-engineering-charm-template/refs/heads/main/.github/workflows/test_terraform_modules.yaml

  • Adapt the k8s-controller and lxd-controller value depending on the charm type.
  • Adapt the terraform-directories to reflect where the modules are in this charm.

Maintain

Configuring renovate

Configure renovate like https://raw.githubusercontent.com/canonical/platform-engineering-charm-template/refs/heads/main/renovate.json to

  • Add a charmhub datasource and use it.
  • Add a regex custom manager for revisions.
  • Set ignorePath to an empty array to not exclude the tests/ folders of terraform.
Weekly Installs
9
First Seen
Feb 20, 2026
Installed on
gemini-cli9
claude-code9
github-copilot9
opencode8
codex5
kimi-cli5