-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix: Replace deprecated splat expression with [*] for Terraform 1.5.6… #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Replace deprecated splat expression with [*] for Terraform 1.5.6… #19
Conversation
WalkthroughThe pull request involves a modification to the Terraform configuration for AWS KMS (Key Management Service) in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟠 Require terratestWaiting checks:
|
@goruha ,could you please review this PR for corrections made to splat expressions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/kms.tf (1)
42-42
: Consider adding a comment about the syntax update.To help future maintainers understand the syntax choice, consider adding a comment explaining that
[*]
is the preferred syntax for Terraform 0.12+ list operations.+ # Using [*] syntax for list operations as per Terraform 0.12+ best practices format("arn:%s:iam::%s:root", join("", data.aws_partition.current[*].partition), join("", data.aws_caller_identity.current[*].account_id))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/kms.tf
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Mergify Merge Protections
- GitHub Check: Mergify Merge Protections
- GitHub Check: Summary
🔇 Additional comments (2)
src/kms.tf (2)
42-42
: LGTM! Correct implementation of the new splat expression syntax.The change from
*.partition
to[*].partition
aligns with Terraform 0.12+ best practices while maintaining the same functionality.
42-42
: Verify consistent syntax usage across the codebase.Let's ensure all splat expressions are updated to use the new syntax.
✅ Verification successful
Splat expression syntax is consistent across the codebase ✅
All Terraform files use the new
[*]
splat expression syntax consistently. No instances of the legacy.*.
syntax were found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for remaining legacy splat expressions in Terraform files rg -t tf '\.\\*\.' . # Search for the new syntax to compare rg -t tf '\[\*\]\.' .Length of output: 653
4ddd5d2
into
cloudposse-terraform-components:main
@sushmithakumar thanks for your contirbution |
These changes were released in v1.536.0. |
Terraform 0.12.0+ Splat Operator Updates
What
Updated Terraform configuration to replace legacy splat syntax
with modern bracket-based expressions
(resource[*].attribute).
Incorporated for expressions where applicable to improve flexibility and readability.
No functional changes to infrastructure; these updates are syntax improvements.
Why
Aligns with Terraform 0.12.0+ enhancements and first-class expression support.
Improves readability and maintainability of Terraform code.
Prevents potential deprecation warnings by replacing outdated syntax.
References
Terraform v0.12.0 Upgrade Guide