Skip to content

Instantly share code, notes, and snippets.

@vukasin-nikodijevic
Last active January 16, 2020 13:07
Show Gist options
  • Save vukasin-nikodijevic/3331e5f2f6e87ae15dc9affeec7ac009 to your computer and use it in GitHub Desktop.
Save vukasin-nikodijevic/3331e5f2f6e87ae15dc9affeec7ac009 to your computer and use it in GitHub Desktop.
terraform

Workaround the issue:

hashicorp/terraform-provider-kubernetes#546

hashicorp/terraform-provider-kubernetes#546 (comment)

Steps to take

terraform state rm kubernetes_service_account.tiller \
  kubernetes_namespace.mi-system \
  'kubernetes_cluster_role_binding.k8s_permissions["kubernetes-admin"]' \
  kubernetes_secret.external_dns \
  kubernetes_cluster_role_binding.tiller kubernetes_secret.velero
function import {
  terraform import \
  -var "tag_build=blah" \
  -var "tag_source=asdfas" \
  -var "oidc_aad_server_secret=${AZ_OIDC_AAD_SERVER_SECRET}" \
  --var-file=config/curious-rabbit.tfvars \
  "${@}"
}
import kubernetes_service_account.tiller kube-system/tiller
import kubernetes_namespace.mi-system mi-system
import 'kubernetes_cluster_role_binding.k8s_permissions["kubernetes-admin"]' kubernetes-admin
import kubernetes_secret.external_dns kube-system/curious-rabbit-external-dns
import kubernetes_secret.velero mi-system/curious-rabbit-velero
import kubernetes_cluster_role_binding.tiller tiller

Run apply again:

terraform apply \
  -var "tag_build=blah" \
  -var "tag_source=asdfas" \
  -var "oidc_aad_server_secret=${AZ_OIDC_AAD_SERVER_SECRET}" \
  --var-file=config/curious-rabbit.tfvars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment