index
index 从列表中获取指定索引处的条目。
输入
| 名称 | 类型 | 描述 |
|---|---|---|
list | array[string] | array[integer] | array[buffer] | 要从中检索条目的列表 |
index | integer | 要检索的条目的索引 |
输出
| 名称 | 类型 | 描述 |
|---|---|---|
value | string | 列表中指定索引处的条目 |
output "entry" {value = index(['a', 'b', 'c'], 1)}// > entry: b
Is this page helpful?