Remove cloudposse/template provider; migrate to templatefile()#60
Conversation
Replace the deprecated `data "template_file"` user-data rendering with the core `templatefile()` function and drop the `cloudposse/template` provider from `required_providers`. Also bumps Go test module to 1.26.1 and refreshes all test dependencies. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 39 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe pull request removes a dependency on the CloudPosse Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Important Do not edit the Please update the Could you fix it @aknysh? 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.tf`:
- Around line 9-11: The userdata assignment unconditionally calls
templatefile("${path.module}/templates/userdata.sh.tmpl", { user_data =
var.user_data }) which triggers evaluation even when local.enabled is false;
change the userdata expression to only call templatefile when local.enabled is
true (e.g., use a conditional expression that returns null or an empty string
when local.enabled is false) so that templatefile() is skipped and disabled-path
behavior is preserved; update the userdata assignment where templatefile() is
used and reference local.enabled, templatefile(), and var.user_data in the
conditional.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b6ff7306-8b93-4c6b-b163-993dc801a8d8
⛔ Files ignored due to path filters (1)
test/go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
README.mdsrc/README.mdsrc/main.tfsrc/versions.tftest/go.mod
💤 Files with no reviewable changes (3)
- src/README.md
- README.md
- src/versions.tf
Preserve the disabled-path behavior of the original `data "template_file"` resource, which was scoped via `count = local.enabled ? 1 : 0`. The `local` is now only evaluated when the component is enabled, avoiding potential plan-time failures when `var.user_data` is unset in disabled deployments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The v1.8.0 module pinned `cloudposse/utils` to `>= 1.7.1, < 2.0.0`, which conflicts with modern components that require `utils >= 2.0.0`. v2.0.0 of the remote-state module pins `utils >= 2.0.0, < 3.0.0`, resolving the `terraform init` provider-resolution failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/terratest |
Point `account-map` at `cloudposse-terraform-components/aws-account-map` v1.537.2 (instead of the old monorepo `terraform-aws-components` 1.520.0 which used stack-config 1.5.0 → pinning utils < 2.0.0). Point `vpc` at aws-vpc v2.2.0 (from v1.536.0). Both modern versions use `cloudposse/stack-config/yaml//modules/remote-state` 2.0.0, which pins `cloudposse/utils >= 2.0.0, < 3.0.0` — compatible with the bumped src. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/terratest |
|
These changes were released in v2.0.0. |
what
cloudposse/templateprovider fromsrc/versions.tfdata "template_file" "userdata"with the coretemplatefile()function (assigned to alocal)base64encode(local.userdata)tomodule.ec2_instance.user_data_base641.26.1and refresh all test dependencies to latest compatible versionsREADME.md/src/README.mdviaatmos readmewhy
cloudposse/templateprovider is a fork of the long-deprecatedhashicorp/templateprovider. It is unmaintained and does not ship modern platform builds (e.g. no nativedarwin_arm64/linux_arm64in recent releases)template_file— is superseded by the coretemplatefile()function that has been available in Terraform 0.12+ / OpenTofu 1.0+references
templatefile()docs: https://opentofu.org/docs/language/functions/templatefile/Summary by CodeRabbit
Chores
Documentation