-
-
Notifications
You must be signed in to change notification settings - Fork 1
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.… #7
base: main
Are you sure you want to change the base?
fix: Replace deprecated splat expression with [*] for Terraform 1.5.… #7
Conversation
WalkthroughThe pull request introduces a minor modification to the Terraform configuration file Changes
Poem
🪧 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 (
|
/terratest |
Important Title is necessary and should not be empty.Kindly provide a meaningful title for this Pull Request. |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟠 Require terratestWaiting checks:
|
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 (2)
src/main.tf (2)
3-3
: LGTM! Correct usage of the modern splat expression syntax.The change from
.*
to[*]
aligns with Terraform's recommended syntax for splat expressions introduced in version 0.12+. This is a safe, non-functional change that improves code maintainability.Consider using a for expression as an alternative, which might be more explicit:
- service_name_set = toset(compact(values(local.quotas)[*].service_name)) + service_name_set = toset([for quota in values(local.quotas) : quota.service_name if quota.service_name != null])This eliminates the need for the
compact()
function and makes the null checking more explicit.
Line range hint
1-85
: Well-structured configuration with good documentation and error handling.The overall configuration demonstrates several good practices:
- Clear documentation of API limitations and workarounds
- Proper handling of default values and drift
- Well-structured data transformations
- Good use of Terraform's map and set operations
Consider adding a
README.md
or HCL comments documenting the expected format of thevar.quotas
input variable, as it's a critical part of this configuration.
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
Summary by CodeRabbit
service_name_set
in the configuration for improved clarity.