Skip to content

Commit

Permalink
fix: revert to kubectl provider for volumesnapshotclass
Browse files Browse the repository at this point in the history
Because of hashicorp/terraform-provider-kubernetes#1367

First deployment of VolumeSnapshotClass fail because the CRDs does not
exist yet.

Fixes #807

Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs committed Jan 27, 2022
1 parent 69e31d0 commit 31ce8cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
7 changes: 4 additions & 3 deletions modules/aws/aws-ebs-csi-driver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 31ce8cf

Please sign in to comment.