Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 1b36289

Browse files
F21alexk53
authored andcommitted
Add customizable create and delete timeouts for DNS zone and DNS zone record resources
1 parent 975a2f7 commit 1b36289

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

docs/resources/gcore_dns_zone.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,22 @@ resource "gcore_dns_zone" "example_zone" {
2929

3030
- `name` (String) A name of DNS Zone resource.
3131

32+
### Optional
33+
34+
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
35+
3236
### Read-Only
3337

3438
- `id` (String) The ID of this resource.
3539

40+
<a id="nestedblock--timeouts"></a>
41+
### Nested Schema for `timeouts`
42+
43+
Optional:
44+
45+
- `create` (String)
46+
- `delete` (String)
47+
3648
## Import
3749

3850
Import is supported using the following syntax:

docs/resources/gcore_dns_zone_record.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ resource "gcore_dns_zone_record" "subdomain_examplezone_caa" {
113113
### Optional
114114

115115
- `filter` (Block Set) (see [below for nested schema](#nestedblock--filter))
116+
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
116117
- `ttl` (Number) A ttl of DNS Zone Record resource.
117118

118119
### Read-Only
@@ -158,6 +159,15 @@ Optional:
158159
- `limit` (Number) A DNS Zone Record filter option that describe how many records will be percolated.
159160
- `strict` (Boolean) A DNS Zone Record filter option that describe possibility to return answers if no records were percolated through filter.
160161

162+
163+
<a id="nestedblock--timeouts"></a>
164+
### Nested Schema for `timeouts`
165+
166+
Optional:
167+
168+
- `create` (String)
169+
- `delete` (String)
170+
161171
## Import
162172

163173
Import is supported using the following syntax:

gcore/resource_gcore_dns_zone.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"log"
77
"strings"
8+
"time"
89

910
"github.com/hashicorp/go-cty/cty"
1011
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -33,6 +34,10 @@ func resourceDNSZone() *schema.Resource {
3334
Description: "A name of DNS Zone resource.",
3435
},
3536
},
37+
Timeouts: &schema.ResourceTimeout{
38+
Create: schema.DefaultTimeout(5 * time.Minute),
39+
Delete: schema.DefaultTimeout(5 * time.Minute),
40+
},
3641
CreateContext: checkDNSDependency(resourceDNSZoneCreate),
3742
ReadContext: checkDNSDependency(resourceDNSZoneRead),
3843
DeleteContext: checkDNSDependency(resourceDNSZoneDelete),

gcore/resource_gcore_dns_zone_record.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"log"
88
"net"
99
"strings"
10+
"time"
1011

1112
dnssdk "github.com/G-Core/gcore-dns-sdk-go"
1213
"github.com/hashicorp/go-cty/cty"
@@ -232,6 +233,10 @@ func resourceDNSZoneRecord() *schema.Resource {
232233
Description: "An array of contents with meta of DNS Zone Record resource.",
233234
},
234235
},
236+
Timeouts: &schema.ResourceTimeout{
237+
Create: schema.DefaultTimeout(5 * time.Minute),
238+
Delete: schema.DefaultTimeout(5 * time.Minute),
239+
},
235240
CreateContext: checkDNSDependency(resourceDNSZoneRecordCreate),
236241
UpdateContext: checkDNSDependency(resourceDNSZoneRecordUpdate),
237242
ReadContext: checkDNSDependency(resourceDNSZoneRecordRead),

0 commit comments

Comments
 (0)