Kubernetes ConfigMap YAML into Terraform Kubernetes
The issue that I had is that I was trying to assign an object to a string literal.
I needed to use the EOF
syntax as follows:
resource "kubernetes_config_map" "opentsdb" { metadata { name = "opentsdb-config" namespace = "dev" } data = { "opentsdb.conf" = <<EOFgoogle.bigtable.project.id = ${var.project_id}google.bigtable.instance.id = ${var.bigtable_instance_id}google.bigtable.zone.id = ${var.zone}hbase.client.connection.impl = com.google.cloud.bigtable.hbase1_2.BigtableConnectiongoogle.bigtable.auth.service.account.enable = truetsd.network.port = 4242tsd.core.auto_create_metrics = truetsd.core.meta.enable_realtime_ts = truetsd.core.meta.enable_realtime_uid = truetsd.core.meta.enable_tsuid_tracking = truetsd.http.request.enable_chunked = truetsd.http.request.max_chunk = 131072tsd.storage.fix_duplicates = truetsd.storage.enable_compaction = falsetsd.storage.max_tags = 12tsd.http.staticroot = /opentsdb/build/staticroottsd.http.cachedir = /tmp/opentsdb EOF }}