23 role_ref {
24 api_group = "rbac.authorization.k8s.io"
25 kind = "ClusterRole"
26 name = kubernetes_cluster_role.api.metadata.0.name 27 }
28
29 subject {
97
98 spec {
99 automount_service_account_token = true
100 service_account_name = kubernetes_service_account.api.metadata.0.name101 share_process_namespace = true
102
103 dynamic "image_pull_secrets" {
29 subject {
30 kind = "ServiceAccount"
31 name = kubernetes_service_account.api.metadata.0.name
32 namespace = kubernetes_service_account.api.metadata.0.namespace 33 }
34}
35
28
29 subject {
30 kind = "ServiceAccount"
31 name = kubernetes_service_account.api.metadata.0.name 32 namespace = kubernetes_service_account.api.metadata.0.namespace
33 }
34}
5
6output "url" {
7 depends_on = [kubernetes_stateful_set.elasticsearch]
8 value = "http://${kubernetes_service.elasticsearch.metadata.0.name}.${var.namespace}.svc.cluster.local:9200"9}
Terraform v0.12
supports traditional square brackets for accessing list items by index.
However, for backward compatibility with v0.11
, Terraform continues to support accessing list items with the dot syntax normally used for attributes.
While Terraform does not print warnings for this syntax, it is no longer documented and its use is discouraged.
It is therefore recommended to switch to the square bracket syntax when accessing items in list, including resources that use count.
locals {
list = ["a", "b", "c"]
value = list.0
}