Skip to content

fix(lightdash/aws): migrate deprecated kubernetes namespace and service account resources to v1 - #932

Open
bpc-oss wants to merge 1 commit into
pluralsh:mainfrom
bpc-oss:codex/lightdash-aws-k8s-v1
Open

fix(lightdash/aws): migrate deprecated kubernetes namespace and service account resources to v1#932
bpc-oss wants to merge 1 commit into
pluralsh:mainfrom
bpc-oss:codex/lightdash-aws-k8s-v1

Conversation

@bpc-oss

@bpc-oss bpc-oss commented Jun 24, 2026

Copy link
Copy Markdown

Closes #930.

This switches the Lightdash AWS Terraform module from the deprecated Kubernetes resources to the v1 resources and updates the depends_on reference to match.

I validated the module in an isolated copy with:

  • terraform fmt -check main.tf
  • terraform init -backend=false
  • terraform validate

I also checked the upgrade path against existing state in a local kind/Terraform lab. A straight rename is not enough here: Terraform plans to destroy and recreate these resources, and moved is not supported for this type change. The safe path I found was a one-time root-level migration using removed { destroy = false } and import. After importing state into the _v1 addresses, the next terraform plan is clean.

The checked-in terraform.tfvars is only a template, so the validation run used temporary concrete values for namespace and cluster_name.

I did not run a full plural link/build/deploy flow from this environment.

Existing-state migration note

Because Terraform does not support moved across these resource types, existing installs need a one-time root-level migration during upgrade. The pattern I tested was:

removed {
  from = module.<your-module>.kubernetes_service_account.postgres
  lifecycle {
    destroy = false
  }
}

removed {
  from = module.<your-module>.kubernetes_namespace.lightdash
  lifecycle {
    destroy = false
  }
}

import {
  to = module.<your-module>.kubernetes_namespace_v1.lightdash
  id = "<namespace>"
}

import {
  to = module.<your-module>.kubernetes_service_account_v1.postgres
  id = "<namespace>/postgres-pod"
}

After that apply, the next terraform plan should be clean.

@bpc-oss
bpc-oss requested a review from michaeljguarino as a code owner June 24, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[maintenance] Update deprecated kubernetes_namespace/service_account to v1 in lightdash/terraform/aws/main.tf

1 participant