-
-
Notifications
You must be signed in to change notification settings - Fork 223
feat: Complex variable types for module zones #111
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
feat: Complex variable types for module zones #111
Conversation
This PR has been automatically marked as stale because it has been open 30 days |
Not stale |
This PR has been automatically marked as stale because it has been open 30 days |
This is really nice! Any chance of getting your input here @antonbabenko ? |
Yes, I plan to get back to this and many other PRs in terraform-aws-modules after AWS reinvent. |
This PR has been automatically marked as stale because it has been open 30 days |
How was re:invent @antonbabenko ? 😅 |
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.
These changes certainly look like an improvement, but it is essential to keep backward compatibility in mind and don't introduce breaking changes.
Please make sure that the code in examples/complete
works as expected (now I see the error: each.value.vpc is null Cannot use a null value in for_each.
).
@BeyondEvil Thanks for asking, it went well - https://www.youtube.com/watch?v=fX7c2GGqTWs 😅 |
Oh nice! I'll have a look. 👍 |
This PR has been automatically marked as stale because it has been open 30 days |
ping @kevcube |
not stale |
This PR has been automatically marked as stale because it has been open 30 days |
not stale I might be able to fix the issue in a couple of weeks if @kevcube doesn't respond. |
name = lookup(each.value, "domain_name", each.key) | ||
comment = lookup(each.value, "comment", null) | ||
force_destroy = lookup(each.value, "force_destroy", false) | ||
name = coalesce(each.value.domain_name, each.key) |
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.
name = coalesce(each.value.domain_name, each.key) | |
name = try(each.value.domain_name, each.key) |
type = map(object({ | ||
domain_name = optional(string) | ||
comment = optional(string) | ||
force_destroy = optional(bool) |
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.
to maintain current behavior:
force_destroy = optional(bool) | |
force_destroy = optional(bool, false) |
|
||
dynamic "vpc" { | ||
for_each = try(tolist(lookup(each.value, "vpc", [])), [lookup(each.value, "vpc", {})]) | ||
for_each = each.value.vpc |
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.
not quite, I think we need more guards/checks
for_each = each.value.vpc | |
for_each = each.value.vpc != null ? each.value.vpc : [] |
This PR has been automatically marked as stale because it has been open 30 days |
This PR was automatically closed because of stale in 10 days |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
use descriptive variable types.
versions.tf
already specifies higher than 1.3.0 so no change needed there.