diff --git a/kubernetes/resource_kubernetes_ingress_v1.go b/kubernetes/resource_kubernetes_ingress_v1.go index 94aea11f0d..e126dcb996 100644 --- a/kubernetes/resource_kubernetes_ingress_v1.go +++ b/kubernetes/resource_kubernetes_ingress_v1.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "log" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" networking "k8s.io/api/networking/v1" @@ -25,6 +26,10 @@ func resourceKubernetesIngressV1() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, Schema: resourceKubernetesIngressV1Schema(), + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(20 * time.Minute), + Delete: schema.DefaultTimeout(20 * time.Minute), + }, } } diff --git a/kubernetes/resource_kubernetes_ingress_v1_test.go b/kubernetes/resource_kubernetes_ingress_v1_test.go index bd0719d24c..ebe1944c51 100644 --- a/kubernetes/resource_kubernetes_ingress_v1_test.go +++ b/kubernetes/resource_kubernetes_ingress_v1_test.go @@ -414,6 +414,9 @@ func testAccKubernetesIngressV1Config_serviceBackend(name string) string { } } } + timeouts { + create = "45m" + } }`, name) } @@ -641,6 +644,9 @@ resource "kubernetes_ingress_v1" "test" { } } wait_for_load_balancer = true + timeouts { + create = "45m" + } }`, name, name, name, name, name, name, name) } diff --git a/website/docs/r/ingress_v1.html.markdown b/website/docs/r/ingress_v1.html.markdown index 884976eacc..ca30268e2b 100644 --- a/website/docs/r/ingress_v1.html.markdown +++ b/website/docs/r/ingress_v1.html.markdown @@ -10,7 +10,6 @@ description: |- Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. - ## Example Usage ```hcl @@ -306,6 +305,13 @@ The following arguments are supported: * `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). * `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). +## Timeouts + +The following [Timeout](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) +configuration options are available for the `kubernetes_ingress_v1` resource: + +* `create` - ingress load balancer creation timeout (default `20 minutes`). +* `delete` - ingress load balancer deletion timeout (default `20 minutes`). ## Import