I upgraded to version 2.8.0 of the hashicorp/kubernetes
provider but noticed that when I’m trying to update the name and properties of existing k8s resources using kubernetes_manifest
, terraform will create a duplicate resource with the new name instead of updating the existing one or deleting it:
resource "kubernetes_manifest" "gateway" {
manifest = yamldecode(
<<EOT
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: sample-gw
namespace: ${var.namespace}
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- ${var.host}
port:
number: 80
name: http
protocol: HTTP
tls:
httpsRedirect: true
- hosts:
- ${var.host}
port:
name: https
number: 443
protocol: HTTPS
tls:
mode: SIMPLE
credentialName: secret-tls
EOT
)
}
Is this the expected outcome or is there a flag or value I can set to prevent this behavior?