Terraform-provider-kubernetes: Issue with terraform 0.12 and kubernetes_config_map

Created on 23 May 2019  路  2Comments  路  Source: hashicorp/terraform-provider-kubernetes

Terraform Version

Terraform v0.12.0

  • provider.aws v2.11.0
  • provider.kubernetes v1.7.0

Affected Resource(s)

kubernetes_config_map

Terraform Configuration Files

On this block

resource "kubernetes_config_map" "aws_auth_configmap" {

  metadata {
    name      = "aws-auth"
    namespace = "kube-system"
  }

  data {
    mapRoles = <<YAML
- rolearn: ${data.aws_iam_role.eks_cluster_iam_role.arn}
  username: system:node:{{EC2PrivateDNSName}}
  groups:
    - system:bootstrappers
    - system:nodes
- rolearn: ${data.aws_iam_role.bastion_role.arn}
  username: kubectl-access-user
  groups:
    - system:masters
YAML
  }
}

I'm having this error

Error: Unsupported block type

  on ../modules/eks/kubectl_caller_permission_fix.tf line 17, in resource "kubernetes_config_map" "aws_auth_configmap":
  17:   data {

Blocks of type "data" are not expected here. Did you mean to define argument
"data"? If so, use the equals sign to assign it a value.

Expected Behavior

Data block should not throw an error

Actual Behavior

Seems the data block inside the kubernetes provider is not well recognized ?

Thanks for helping out !

Most helpful comment

I think I found out.

Simply replace "data {" by "data = {"

All 2 comments

I think I found out.

Simply replace "data {" by "data = {"

Looks like a crutch

Was this page helpful?
0 / 5 - 0 ratings