From 489d8b4669a5771d220fe22db0df3d5bbc982b33 Mon Sep 17 00:00:00 2001 From: Valentin Widmer Date: Mon, 9 Oct 2023 15:14:56 +0700 Subject: [PATCH] Migrate network policies from kubectl to kubernetes provider --- patterns/aws-vpc-cni-network-policy/main.tf | 224 +++++++++--------- .../aws-vpc-cni-network-policy/versions.tf | 4 - 2 files changed, 115 insertions(+), 113 deletions(-) diff --git a/patterns/aws-vpc-cni-network-policy/main.tf b/patterns/aws-vpc-cni-network-policy/main.tf index 3d7dc2e321..2f1d6d3966 100644 --- a/patterns/aws-vpc-cni-network-policy/main.tf +++ b/patterns/aws-vpc-cni-network-policy/main.tf @@ -28,20 +28,6 @@ provider "helm" { } } -provider "kubectl" { - apply_retry_count = 5 - host = module.eks.cluster_endpoint - cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) - load_config_file = false - - exec { - api_version = "client.authentication.k8s.io/v1beta1" - command = "aws" - # This requires the awscli to be installed locally where Terraform is executed - args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name] - } -} - data "aws_availability_zones" "available" {} locals { @@ -164,120 +150,140 @@ module "addons" { ################################################################################ # Block all ingress and egress traffic within the stars namespace -resource "kubectl_manifest" "default_deny_stars" { - yaml_body = <