From 31ce8cf31055533a9b068fe7e3b75ce44c39241e Mon Sep 17 00:00:00 2001 From: Kevin Lefevre Date: Thu, 27 Jan 2022 13:52:40 +0100 Subject: [PATCH] fix: revert to kubectl provider for volumesnapshotclass Because of https://github.com/hashicorp/terraform-provider-kubernetes/issues/1367 First deployment of VolumeSnapshotClass fail because the CRDs does not exist yet. Fixes #807 Signed-off-by: Kevin Lefevre --- modules/aws/README.md | 2 +- modules/aws/aws-ebs-csi-driver.tf | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/aws/README.md b/modules/aws/README.md index 819a1fcf3..4f3b24db7 100644 --- a/modules/aws/README.md +++ b/modules/aws/README.md @@ -148,6 +148,7 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [helm_release.velero](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [helm_release.victoria-metrics-k8s-stack](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | | [kubectl_manifest.apply](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.aws-ebs-csi-driver_vsc](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | | [kubectl_manifest.cert-manager_cluster_issuers](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | | [kubectl_manifest.cni-metrics-helper](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | | [kubectl_manifest.csi-external-snapshotter](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | @@ -157,7 +158,6 @@ This module can uses [IRSA](https://aws.amazon.com/blogs/opensource/introducing- | [kubectl_manifest.secrets-store-csi-driver-provider-aws](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | | [kubectl_manifest.sync](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | | [kubernetes_config_map.loki-stack_grafana_ds](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | -| [kubernetes_manifest.aws-ebs-csi-driver_vsc](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest) | resource | | [kubernetes_namespace.admiralty](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.aws-ebs-csi-driver](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | [kubernetes_namespace.aws-efs-csi-driver](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | diff --git a/modules/aws/aws-ebs-csi-driver.tf b/modules/aws/aws-ebs-csi-driver.tf index fec6da329..c672e807e 100644 --- a/modules/aws/aws-ebs-csi-driver.tf +++ b/modules/aws/aws-ebs-csi-driver.tf @@ -213,12 +213,13 @@ resource "aws_kms_alias" "aws-ebs-csi-driver" { target_key_id = aws_kms_key.aws-ebs-csi-driver.0.id } -resource "kubernetes_manifest" "aws-ebs-csi-driver_vsc" { - count = local.aws-ebs-csi-driver.enabled && local.aws-ebs-csi-driver.volume_snapshot_class != null ? 1 : 0 - manifest = yamldecode(local.aws-ebs-csi-driver.volume_snapshot_class) +resource "kubectl_manifest" "aws-ebs-csi-driver_vsc" { + count = local.aws-ebs-csi-driver.enabled && local.aws-ebs-csi-driver.volume_snapshot_class != null ? 1 : 0 + yaml_body = local.aws-ebs-csi-driver.volume_snapshot_class depends_on = [ kubectl_manifest.csi-external-snapshotter, helm_release.aws-ebs-csi-driver ] + server_side_apply = true }