You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supplying dynamic (computed during apply) values to a provider is currently not supported (ref hashicorp/terraform#27934), AKA "provision a thing, then provision another thing inside the thing you just provisioned" ref hashicorp/terraform#2430 (comment)
Workaround
Avoid providing dynamic value to provider: pass a constant filename
Add appropriate depends_on to all its resources to ensure proper creation and destruction order
Expected behaviour
kubectl provider only initialises once the first kubectl_manifest is applied (at this point in time, the kubernetes cluster is running and the kubeconfig file now exists/is updated on disk)
Actual behaviour
kubectl_manifest resources will fail to apply on the first run:
failed to create kubernetes rest client for update of resource: Get "http://localhost/api?timeout=32s": dial tcp [::1]:80: connect: connection refused
@ddelange you need to use the exec plugin authentication for Kubernetes or other kubernetes based providers such as helm or kubectl, AFAIK this is the only really reliable way to authenticate against Kubernetes.
Scenario
Provision a kubernetes cluster - and apply some default configuration to it using
kubectl
- in the same terraform moduleExample use-case: eddycharly/terraform-provider-kops#438 (comment)
Problem
Supplying dynamic (computed during apply) values to a provider is currently not supported (ref hashicorp/terraform#27934), AKA "provision a thing, then provision another thing inside the thing you just provisioned" ref hashicorp/terraform#2430 (comment)
Workaround
config_path
to thehelm
provider will only initialise when it's needed for ahelm_release
resource ref Configuring one provider with a dynamic attribute from another (was: depends_on for providers) hashicorp/terraform#2430 (comment)depends_on
to all its resources to ensure proper creation and destruction orderExpected behaviour
kubectl provider only initialises once the first
kubectl_manifest
is applied (at this point in time, the kubernetes cluster is running and the kubeconfig file now exists/is updated on disk)Actual behaviour
kubectl_manifest
resources will fail to apply on the first run:Related issues
The text was updated successfully, but these errors were encountered: