-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: adjust deprecated lookup function #16
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
Conversation
lookup(map, key) was useful in older Terraform versions when maps were sometimes nullable. Direct indexing (map["key"]) is now preferred because it is more readable, Terraform explicitly fails if the key doesn’t exist, and it aligns with standard programming practices
WalkthroughThe pull request modifies the Terraform configuration in Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
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/main.tf (1)
15-16: Direct Indexing forname_suffixUpdated
The change replaces the use of thelookupfunction with direct key access (v["name_suffix"]), which improves readability and ensures Terraform explicitly fails if the key is missing. However, note that the conditional check on line 10 still useslookup(v, "name_suffix", null) != null. For consistency and clearer intent, consider updating this condition to use direct indexing as well (e.g.,v["name_suffix"] != null).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main.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
Gowiem
left a comment
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.
!
|
@RoseSecurity linting is unhappy, mind digging in? |
Ah, good catch. This might take some reworking |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
|
These components are an interesting case because we don't have a test account to run the Terratests in |
|
/terratest |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
|
Heads up! This pull request looks stale. It will be closed soon, if there are no new commits. ⏳ |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/provider-datadog.tf(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
|
These changes were released in v1.535.1. |
what
This pull request includes a small change to the
src/main.tffile. The change modifies the wayname_suffixandnamevalues are accessed within thelocalsblock.src/main.tf: Updated the access method forname_suffixandnamevalues to use direct key access instead of thelookupfunction.why
lookup(map, key)was useful in older Terraform versions when maps were sometimes nullable. Direct indexing (map["key"]) is now preferred because it is more readable, Terraform explicitly fails if the key doesn’t exist, and it aligns with standard programming practicesreferences
Summary by CodeRabbit