Open Satak opened 9 months ago
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
One more use case is while creating dynamic blocks with a list of different map objects.
variable "rules_list"{
type = list(map(string))
default=[
{"action":"ADD_HTTP_REQUEST_HEADER", "header":"custom_h1", "value":"custom_value"},
{ "action" :"CONTROL_ACCESS_USING_HTTP_METHODS", "allowed_methods = ["GET", "POST"] , status_code ="405"}]
}
resource lbr_rule_set "my_lb_rule_set"{
dynamic items{
for_each = var.rules_list
content = **items.value
}
load_balancer_id = var.lb_id
name = "my_lb_rule_set"
}
Terraform Version
Use Cases
Simplify module calls that have huge amount of input variables. Of course you can refactor the module to just take 1 map as input variable but then you loose the validation and default values from input variable declarations.
This is an example how in Python you can pass multiple arguments by just unpacking a dictionary with
**
operator.Attempted Solutions
Proposal
Or just have the magical
arguments
(or similar parameter) that accepts complex object and under the hood unpacks the object and passes the values to matching input variables declared in the module.References
No response