Skip to content

Conversation

@hatamiarash7
Copy link

  • This PR introduces breaking change.
  • This PR fixes a bug.
  • This PR adds new functionality.
  • This PR enhances existing functionality.

Description of your changes

The generator of Terraform module wrappers will create a fixed example and will not honor variables.

How can we test changes

repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.104.0
    hooks:
      - id: terraform_wrapper_module_for_each
        args:
          - --args=--module-dir=.
          - --args=--module-repo-org=terraform-company-modules
          - --args=--module-repo-provider=company
          - --args=--module-repo-shortname=product
          - --args=--verbose

This will generate a fixed example like this:

## Example: Manage multiple S3 buckets in one Terragrunt layer

`eu-west-1/s3-buckets/terragrunt.hcl`:

```hcl
terraform {
  source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers"
  # Alternative source:
  # source = "git::[email protected]:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master"
}
.
.

After this PR, the source examples should be like other examples

terraform {
  source = "tfr:///terraform-company-modules/product/company//wrappers/."
  # Alternative source:
  # source = "git::[email protected]:terraform-company-modules/terraform-company-product.git//wrappers/.?ref=master"
}

Copilot AI review requested due to automatic review settings January 1, 2026 11:01
@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Documentation example source references in the Terraform wrapper module were updated to use placeholder identifiers (MODULE_REPO_ORG, MODULE_REPO_SHORTNAME, MODULE_REPO_PROVIDER, WRAPPER_PATH) instead of concrete S3 bucket module names. No functional or runtime changes.

Changes

Cohort / File(s) Summary
Documentation Template Update
hooks/terraform_wrapper_module_for_each.sh
Replaced hardcoded module repository references with placeholder identifiers in example documentation for Terraform module source and alternative git source configurations

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description provides relevant context about the bug fix, explains what was wrong (fixed S3 example), what changed (now uses variables), and includes testing instructions with before/after examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title references fixing an S3 example in the wrapper, which aligns with the PR's main objective of fixing the generator to use variables instead of hard-coded S3 module references.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the Terraform module wrapper generator was creating a hardcoded S3 bucket example instead of using configurable placeholders that honor the provided variables.

Key Changes

  • Replaced hardcoded AWS S3 module references with placeholder variables in the S3 example section
  • Ensured the example follows the same pattern as other examples in the documentation template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hatamiarash7 hatamiarash7 changed the title Wrapper - Fix S3 example fix(wrapper): Generator - S3 example Jan 1, 2026
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