问题描述
我有下一个列表:
local {
...
step_scaling_out_policy_configuration = {
"adjustment_type" = "ChangeInCapacity"
"cooldown" = 300
"metric_aggregation_type" = "Maximum"
"step_adjustment" = {
"metric_interval_lower_bound" = 0
"scaling_adjustment" = 1
}
}
...
}
我可以使用下一个逻辑转换为块:
step_scaling_policy_configuration {
adjustment_type = local.step_scaling_out_policy_configuration.adjustment_type
cooldown = local.step_scaling_out_policy_configuration.cooldown
metric_aggregation_type = local.step_scaling_out_policy_configuration.metric_aggregation_type
step_adjustment {
metric_interval_lower_bound = local.step_scaling_out_policy_configuration.step_adjustment.metric_interval_lower_bound
scaling_adjustment = local.step_scaling_out_policy_configuration.step_adjustment.scaling_adjustment
}
}
使用固定数量的地图键非常容易。但是可以动态生成这样的块,因为我不确切知道local.step_scaling_out_policy_configuration
映射中可能是什么。现在假设我有
local {
...
step_scaling_out_policy_configuration = {
"adjustment_type" = "ChangeInCapacity"
"cooldown" = 300
"metric_aggregation_type" = "Maximum"
#######
"some_new_key" = "value"
#######
"step_adjustment" = {
"metric_interval_lower_bound" = 0
"scaling_adjustment" = 1
}
}
...
}
很显然,根据以前的逻辑,我不会在some_new_key
块中使用step_scaling_policy_configuration
参数。是否可以根据step_scaling_policy_configuration
映射中的内容向local.step_scaling_out_policy_configuration
块动态添加密钥?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)