Skip to content

chore(terraform): add provider version constraints to internal modules #106

@WilliamBerryiii

Description

@WilliamBerryiii

Summary

The tflint rule terraform_required_providers is generating 44 warnings across internal Terraform modules in the codebase. These warnings occur because internal modules specify provider source but omit version constraints.

Current Behavior

Internal modules like blueprints/dual-peered-single-node-cluster/terraform/modules/apply-scripts use providers without explicit version constraints in their required_providers block.

Expected Behavior

According to HashiCorp best practices, child modules should either:

  1. Specify minimum version constraints (>= x.y.z) for flexibility
  2. Rely on root module version constraints (current approach, but tflint flags this)

Acceptance Criteria

  • Review all 44 affected internal modules
  • Add appropriate minimum version constraints to internal modules
  • Re-enable the terraform_required_providers version check in .tflint.hcl
  • Ensure CI passes with the rule enabled

Technical Details

Affected Providers:

  • azurerm (32 occurrences)
  • azapi (5 occurrences)
  • random (3 occurrences)
  • tls (3 occurrences)
  • azuread (2 occurrences)
  • external (2 occurrences)
  • local (1 occurrence)
  • http (1 occurrence)

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.13.0/docs/rules/terraform_required_providers.md

Workaround

The rule's version check is temporarily disabled in .tflint.hcl while this work is planned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions