Skip to content

refactor(tf): run deploy-cloud on the infra modules #6679

Closed

Description

@dan-petty

Problem

Checked at devops-cli main 4ff4b7c.

  • devops tf deploy-cloud -p <provider> resolves tf/<provider> and tf/environments/<provider>.tfvars.example under the worktree root of the working folder (src/devops_cli/commands/tf.py:93-115,692-693, CONST_TF_* in src/devops_cli/config/constants.py:928-933).
  • Other readers of tf/: src/devops_cli/research/terraform_pins.py:16 (tf/**/*.tf), src/devops_cli/roadmap/step_rules.py:95-99 (tf/** to tf/README.md), the Renovate terraform manager, the AGENTS.md row 'change a manifest, the cluster or OpenTofu', README.md:50 (link to tf/README.md), the knowledge base pages src/devops_cli/ai/knowledge_base/devops_cli/tasks/infrastructure_provisioning.md:21-34 and src/devops_cli/ai/knowledge_base/it_domains/tools/opentofu_terraform.md:27-57, tests/commands/test_tf.py (11 uses of CONST_TF_*), docs/commands/tf.md and docs/CLI_REFERENCE.md.
  • After feat(tf): add cloud cluster modules on maintained modules infra#9, infra holds the modules and the examples. Two copies must not stay live.
  • Open feat(gh): manage GitHub organization and repository settings as code #5311 plans tf/github here, and its root stacks go to dan-petty/homelab tf/github/ (owner decision of 2026-11-21, recorded in docs(adr): record the four homes of the infrastructure #6674).

Proposed remedy

  • CONST_TF_* name tf/examples/<provider> and tf/examples/<provider>/<provider>.tfvars.example, the infra layout. So devops tf deploy-cloud -p <provider> runs with an infra checkout as the working folder. When the folder is missing, the message says to run the command in an infra checkout.
  • Delete tf/aws, tf/azure, tf/gcp, tf/environments and tf/README.md. Keep tf/github if feat(gh): manage GitHub organization and repository settings as code #5311 has added it. Remove the tf/** rule of step_rules.py, or point it to the README of tf/github if that exists. terraform_pins.py keeps its glob, because it reads the root that it gets.
  • Update the AGENTS.md row, README.md:50, the 2 knowledge base pages, the docs and the generated command reference.
  • Change the tests first: tests/commands/test_tf.py builds tmp_path trees in the infra layout.

Acceptance criteria

  • git ls-files tf/aws tf/azure tf/gcp tf/environments tf/README.md | wc -l prints 0, and git grep -n CONST_TF_AWS_DIR finds only the new definition and its readers.
  • With an infra checkout as the working folder, uv run --project <devops-cli checkout> devops tf deploy-cloud -p aws --dry-run prints the init and plan commands for tf/examples/aws and sends no request.
  • git grep -n 'tf/aws\|tf/README' -- README.md src/devops_cli/ai/knowledge_base finds nothing.
  • uv run devops ci --check --only test,lint,typecheck,docs passes.

Person steps

None.

Dependencies

Alternatives check of 2026-11-21: not-applicable.
Class: refactor, no search.
Tool: none found.

Activity

  1. added
    type/refactor
    source/agent
    status/new
    value/medium
    effort/medium
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
    • Scope: none. The title has the scope tf, and .github/labels.yml declares no scope/tf label. Add the label to the file to give the scope to this item.
    • Related: refactor(k8s): read the environment tree from the infra repo #5131, which asks for a different change. Both move a command to read from the infra repo, but 5131 targets k8s/ while this targets tf/ and the deploy-cloud command.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 21, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 22, 2026
  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 14:41 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions