Hi
Can you please tell me how to execute below code in terraform executor.
resource “null_resource” “eks_context_switcher” {
triggers = {
always_run = timestamp()
}
provisioner “local-exec” {
command = “eks-switch-cluster $({var.eks_cluster_name} “XXXXXXXXXXX”)”
}
provisioner “local-exec” {
command = cat <<-“EOF” | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: “true”
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: gitlab-runner
rules:
- apiGroups:
-
authentication.k8s.io
resources: - tokenreviews
verbs: - create
-
authentication.k8s.io
- apiGroups:
-
authorization.k8s.io
resources: - localsubjectaccessreviews
- subjectaccessreviews
verbs:
-
authorization.k8s.io
I am getting below error during terraform apply
│ Error: Unsupported operator
│
│ On …/…/modules/eks_auth/allow_nodes.tf line 39: Bitwise operators are not supported. Did you mean boolean OR (“||”)?
╵
╷
│ Error: Missing newline after argument
│
│ On …/…/modules/eks_auth/allow_nodes.tf line 36: An argument definition must end with a newline.
╵
╷
│ Error: Argument or block definition required
│
│ On …/…/modules/eks_auth/allow_nodes.tf line 40: An argument or block definition is required here. To set an argument, use the equals sign “=” to introduce the argument value.
╵
╷
│ Error: Argument or block definition required
│
│ On …/…/modules/eks_auth/allow_nodes.tf line 41: An argument or block definition is required here. To set an argument, use the equals sign “=” to introduce the argument value.
╵
╷
│ Error: Argument or block definition required
│
│ On …/…/modules/eks_auth/allow_nodes.tf line 42: An argument or block definition is required here. To set an argument, use the equals sign “=” to introduce the argument value.