Skip to content

Commit

Permalink
Add kubernetes_ingress_v1 timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tensho committed Dec 15, 2022
1 parent 8aeeabb commit e6c50a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions kubernetes/resource_kubernetes_ingress_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
networking "k8s.io/api/networking/v1"
Expand All @@ -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),
},
}
}

Expand Down
6 changes: 6 additions & 0 deletions kubernetes/resource_kubernetes_ingress_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ func testAccKubernetesIngressV1Config_serviceBackend(name string) string {
}
}
}
timeouts {
create = "45m"
}
}`, name)
}

Expand Down Expand Up @@ -641,6 +644,9 @@ resource "kubernetes_ingress_v1" "test" {
}
}
wait_for_load_balancer = true
timeouts {
create = "45m"
}
}`, name, name, name, name, name, name, name)
}

Expand Down
8 changes: 7 additions & 1 deletion website/docs/r/ingress_v1.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e6c50a2

Please sign in to comment.