Skip to content

Commit 0ae567c

Browse files
authored
Merge branch 'master' into feat-domain-add-wait-dns-zone-state
2 parents b143b3a + 1b7e08c commit 0ae567c

13 files changed

+867
-866
lines changed

docs/data-sources/domain_record.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data "scaleway_domain_record" "by_id" {
3333
- `name` - (Required) The name of the record (can be an empty string for a root record).
3434
Cannot be used with `record_id`.
3535

36-
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).
36+
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `DNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).
3737
Cannot be used with `record_id`.
3838

3939
- `data` - (Required) The content of the record (an IPv4 for an `A`, a string for a `TXT`...).

docs/resources/domain_record.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ The following arguments are supported:
190190

191191
- `name` - (Optional) The name of the record (can be an empty string for a root record).
192192

193-
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).
193+
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `DNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).
194194

195195
- `data` - (Required) The content of the record (an IPv4 for an `A`, a string for a `TXT`...).
196196

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
1111
github.com/hashicorp/go-retryablehttp v0.7.1
1212
github.com/hashicorp/terraform-plugin-sdk/v2 v2.13.0
13-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220413124200-87ec17340712
13+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220414162120-5b6c03f0ce5f
1414
github.com/stretchr/testify v1.7.1
1515
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f
1616

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
868868
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
869869
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
870870
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
871-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220413124200-87ec17340712 h1:MOkU+rQ1ZIIqYAjCUwd1qaOapaECgic6kZjuT+iK2/Y=
872-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220413124200-87ec17340712/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
871+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220414162120-5b6c03f0ce5f h1:iHIYJFID9/T8F3BDVymesruLN71NSUdpsV8m7s5eDEA=
872+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220414162120-5b6c03f0ce5f/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
873873
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
874874
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
875875
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=

scaleway/resource_domain_record.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func resourceScalewayDomainRecord() *schema.Resource {
5757
domain.RecordTypeAAAA.String(),
5858
domain.RecordTypeALIAS.String(),
5959
domain.RecordTypeCNAME.String(),
60+
domain.RecordTypeDNAME.String(),
6061
domain.RecordTypeMX.String(),
6162
domain.RecordTypeNS.String(),
6263
domain.RecordTypePTR.String(),
@@ -286,6 +287,7 @@ func resourceScalewayDomainRecordRead(ctx context.Context, d *schema.ResourceDat
286287

287288
res, err := domainAPI.ListDNSZoneRecords(&domain.ListDNSZoneRecordsRequest{
288289
DNSZone: dnsZone,
290+
ID: &id,
289291
}, scw.WithAllPages())
290292

291293
if err != nil {
@@ -297,10 +299,8 @@ func resourceScalewayDomainRecordRead(ctx context.Context, d *schema.ResourceDat
297299
}
298300

299301
for _, r := range res.Records {
300-
if r.ID == id {
301-
record = r
302-
break
303-
}
302+
record = r
303+
break
304304
}
305305
} else {
306306
dnsZone = d.Get("dns_zone").(string)

scaleway/testdata/data-source-domain-record-basic.cassette.yaml

+386-386
Large diffs are not rendered by default.

scaleway/testdata/data-source-domain-zone-basic.cassette.yaml

+30-30
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interactions:
2020
Content-Type:
2121
- application/json
2222
Date:
23-
- Thu, 17 Feb 2022 15:18:19 GMT
23+
- Tue, 19 Apr 2022 09:00:58 GMT
2424
Server:
2525
- Scaleway API-Gateway
2626
Strict-Transport-Security:
@@ -30,7 +30,7 @@ interactions:
3030
X-Frame-Options:
3131
- DENY
3232
X-Request-Id:
33-
- 1f1b5abb-e7f1-4636-be60-be4d833eca38
33+
- 7dc924cf-8a64-4d46-b505-562772a817af
3434
status: 200 OK
3535
code: 200
3636
duration: ""
@@ -46,7 +46,7 @@ interactions:
4646
url: https://api.scaleway.com/domain/v2beta1/dns-zones
4747
method: POST
4848
response:
49-
body: '{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}'
49+
body: '{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}'
5050
headers:
5151
Content-Length:
5252
- "298"
@@ -55,7 +55,7 @@ interactions:
5555
Content-Type:
5656
- application/json
5757
Date:
58-
- Thu, 17 Feb 2022 15:18:20 GMT
58+
- Tue, 19 Apr 2022 09:00:59 GMT
5959
Server:
6060
- Scaleway API-Gateway
6161
Strict-Transport-Security:
@@ -65,7 +65,7 @@ interactions:
6565
X-Frame-Options:
6666
- DENY
6767
X-Request-Id:
68-
- 10d64410-113d-4b54-935e-cef587b225ca
68+
- b04afa50-f29f-447b-8e40-6bfa47b27a78
6969
status: 200 OK
7070
code: 200
7171
duration: ""
@@ -79,7 +79,7 @@ interactions:
7979
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
8080
method: GET
8181
response:
82-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
82+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
8383
headers:
8484
Content-Length:
8585
- "330"
@@ -88,7 +88,7 @@ interactions:
8888
Content-Type:
8989
- application/json
9090
Date:
91-
- Thu, 17 Feb 2022 15:18:20 GMT
91+
- Tue, 19 Apr 2022 09:00:59 GMT
9292
Server:
9393
- Scaleway API-Gateway
9494
Strict-Transport-Security:
@@ -98,7 +98,7 @@ interactions:
9898
X-Frame-Options:
9999
- DENY
100100
X-Request-Id:
101-
- e9eebead-208f-4886-8ede-b95dc33d9810
101+
- 22870c51-7e8a-4fda-91a9-5a68b9d24c64
102102
status: 200 OK
103103
code: 200
104104
duration: ""
@@ -112,7 +112,7 @@ interactions:
112112
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
113113
method: GET
114114
response:
115-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
115+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
116116
headers:
117117
Content-Length:
118118
- "330"
@@ -121,7 +121,7 @@ interactions:
121121
Content-Type:
122122
- application/json
123123
Date:
124-
- Thu, 17 Feb 2022 15:18:20 GMT
124+
- Tue, 19 Apr 2022 09:00:59 GMT
125125
Server:
126126
- Scaleway API-Gateway
127127
Strict-Transport-Security:
@@ -131,7 +131,7 @@ interactions:
131131
X-Frame-Options:
132132
- DENY
133133
X-Request-Id:
134-
- cf52d131-ec1a-4570-b7f0-c82e3145b209
134+
- 1d3406ea-68ea-4e2e-9e69-ed3389094b75
135135
status: 200 OK
136136
code: 200
137137
duration: ""
@@ -145,7 +145,7 @@ interactions:
145145
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
146146
method: GET
147147
response:
148-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
148+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
149149
headers:
150150
Content-Length:
151151
- "330"
@@ -154,7 +154,7 @@ interactions:
154154
Content-Type:
155155
- application/json
156156
Date:
157-
- Thu, 17 Feb 2022 15:18:20 GMT
157+
- Tue, 19 Apr 2022 09:00:59 GMT
158158
Server:
159159
- Scaleway API-Gateway
160160
Strict-Transport-Security:
@@ -164,7 +164,7 @@ interactions:
164164
X-Frame-Options:
165165
- DENY
166166
X-Request-Id:
167-
- d8ed9662-da91-4626-a256-78be3536edbf
167+
- 1eadedf8-6c8c-441b-922e-784a0668c22c
168168
status: 200 OK
169169
code: 200
170170
duration: ""
@@ -178,7 +178,7 @@ interactions:
178178
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
179179
method: GET
180180
response:
181-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
181+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
182182
headers:
183183
Content-Length:
184184
- "330"
@@ -187,7 +187,7 @@ interactions:
187187
Content-Type:
188188
- application/json
189189
Date:
190-
- Thu, 17 Feb 2022 15:18:21 GMT
190+
- Tue, 19 Apr 2022 09:00:59 GMT
191191
Server:
192192
- Scaleway API-Gateway
193193
Strict-Transport-Security:
@@ -197,7 +197,7 @@ interactions:
197197
X-Frame-Options:
198198
- DENY
199199
X-Request-Id:
200-
- 25bd8d9d-b75c-4013-a8a4-e0bf2f722751
200+
- 35692695-b8e9-4484-b8c0-b3f4ea5a521b
201201
status: 200 OK
202202
code: 200
203203
duration: ""
@@ -211,7 +211,7 @@ interactions:
211211
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc&project_id=fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf
212212
method: GET
213213
response:
214-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
214+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
215215
headers:
216216
Content-Length:
217217
- "330"
@@ -220,7 +220,7 @@ interactions:
220220
Content-Type:
221221
- application/json
222222
Date:
223-
- Thu, 17 Feb 2022 15:18:21 GMT
223+
- Tue, 19 Apr 2022 09:00:59 GMT
224224
Server:
225225
- Scaleway API-Gateway
226226
Strict-Transport-Security:
@@ -230,7 +230,7 @@ interactions:
230230
X-Frame-Options:
231231
- DENY
232232
X-Request-Id:
233-
- f1ff645c-94ba-4fa1-a413-a28357171bf0
233+
- b6896d13-92f5-40e5-82a4-a982db837125
234234
status: 200 OK
235235
code: 200
236236
duration: ""
@@ -244,7 +244,7 @@ interactions:
244244
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
245245
method: GET
246246
response:
247-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
247+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
248248
headers:
249249
Content-Length:
250250
- "330"
@@ -253,7 +253,7 @@ interactions:
253253
Content-Type:
254254
- application/json
255255
Date:
256-
- Thu, 17 Feb 2022 15:18:21 GMT
256+
- Tue, 19 Apr 2022 09:00:59 GMT
257257
Server:
258258
- Scaleway API-Gateway
259259
Strict-Transport-Security:
@@ -263,7 +263,7 @@ interactions:
263263
X-Frame-Options:
264264
- DENY
265265
X-Request-Id:
266-
- 783ad0f2-914a-4c7c-a6b0-0806882faaf8
266+
- 921bef56-760f-48de-9136-805a12596175
267267
status: 200 OK
268268
code: 200
269269
duration: ""
@@ -277,7 +277,7 @@ interactions:
277277
url: https://api.scaleway.com/domain/v2beta1/dns-zones?dns_zone=test-zone2.scaleway-terraform.com&domain=&order_by=domain_asc
278278
method: GET
279279
response:
280-
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-02-17T15:18:20Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
280+
body: '{"total_count":1,"dns_zones":[{"domain":"scaleway-terraform.com","subdomain":"test-zone2","ns":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_default":["ns0.dom.scw.cloud","ns1.dom.scw.cloud"],"ns_master":[],"status":"active","message":null,"updated_at":"2022-04-19T09:00:58Z","project_id":"fbda9817-5c05-4e1d-aa8d-a1a8b0b80ddf"}]}'
281281
headers:
282282
Content-Length:
283283
- "330"
@@ -286,7 +286,7 @@ interactions:
286286
Content-Type:
287287
- application/json
288288
Date:
289-
- Thu, 17 Feb 2022 15:18:22 GMT
289+
- Tue, 19 Apr 2022 09:00:59 GMT
290290
Server:
291291
- Scaleway API-Gateway
292292
Strict-Transport-Security:
@@ -296,7 +296,7 @@ interactions:
296296
X-Frame-Options:
297297
- DENY
298298
X-Request-Id:
299-
- 03e70c88-7172-45bc-8c01-f09a8669d70e
299+
- 77182aa1-00d4-460e-96c5-a79fe861a762
300300
status: 200 OK
301301
code: 200
302302
duration: ""
@@ -319,7 +319,7 @@ interactions:
319319
Content-Type:
320320
- application/json
321321
Date:
322-
- Thu, 17 Feb 2022 15:18:23 GMT
322+
- Tue, 19 Apr 2022 09:01:00 GMT
323323
Server:
324324
- Scaleway API-Gateway
325325
Strict-Transport-Security:
@@ -329,7 +329,7 @@ interactions:
329329
X-Frame-Options:
330330
- DENY
331331
X-Request-Id:
332-
- 1dfecb66-f570-41db-9957-90c1c95dd34e
332+
- 29d7a622-d4ae-4529-b299-6fe3e889820a
333333
status: 200 OK
334334
code: 200
335335
duration: ""
@@ -352,7 +352,7 @@ interactions:
352352
Content-Type:
353353
- application/json
354354
Date:
355-
- Thu, 17 Feb 2022 15:18:24 GMT
355+
- Tue, 19 Apr 2022 09:01:00 GMT
356356
Server:
357357
- Scaleway API-Gateway
358358
Strict-Transport-Security:
@@ -362,7 +362,7 @@ interactions:
362362
X-Frame-Options:
363363
- DENY
364364
X-Request-Id:
365-
- 0cec2d11-9648-4376-80d2-eac3c2a928d9
365+
- 9f6bd24f-9081-4320-a0c2-c1236f5c727d
366366
status: 200 OK
367367
code: 200
368368
duration: ""

0 commit comments

Comments
 (0)