Skip to content

Commit 6f3f1cb

Browse files
chore(api): TTL is required on DNS records
1 parent 779c686 commit 6f3f1cb

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b15b44e0efd207de48e7e74e742b0b4b190c74f12a941a1a0ef59a51656a5224.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9cf8d97f015bd3c7509f68b4dea2c37dc5f97183372064702ea540b6dd999f8.yml
33
openapi_spec_hash: 83243c9ee06f88d0fa91e9b185d8a42e
4-
config_hash: e4575ceccb44266d8c23990849b2a5ac
4+
config_hash: cce40d4d65a4d67d5df957a75a15b567

examples/resources/cloudflare_dns_record/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
resource "cloudflare_dns_record" "example_dns_record" {
22
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
33
name = "example.com"
4+
ttl = 3600
45
type = "A"
56
comment = "Domain verification record"
67
content = "198.51.100.4"
@@ -10,5 +11,4 @@ resource "cloudflare_dns_record" "example_dns_record" {
1011
ipv6_only = true
1112
}
1213
tags = ["owner:dns-team"]
13-
ttl = 3600
1414
}

internal/services/dns_record/list_data_source_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ type DNSRecordsTagDataSourceModel struct {
176176

177177
type DNSRecordsResultDataSourceModel struct {
178178
Name types.String `tfsdk:"name" json:"name,computed"`
179+
TTL types.Float64 `tfsdk:"ttl" json:"ttl,computed"`
179180
Type types.String `tfsdk:"type" json:"type,computed"`
180181
Comment types.String `tfsdk:"comment" json:"comment,computed"`
181182
Content types.String `tfsdk:"content" json:"content,computed"`
182183
Proxied types.Bool `tfsdk:"proxied" json:"proxied,computed"`
183184
Settings customfield.NestedObject[DNSRecordsSettingsDataSourceModel] `tfsdk:"settings" json:"settings,computed"`
184185
Tags customfield.List[types.String] `tfsdk:"tags" json:"tags,computed"`
185-
TTL types.Float64 `tfsdk:"ttl" json:"ttl,computed"`
186186
ID types.String `tfsdk:"id" json:"id,computed"`
187187
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
188188
Meta jsontypes.Normalized `tfsdk:"meta" json:"meta,computed"`

internal/services/dns_record/list_data_source_schema.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema {
221221
Description: "DNS record name (or @ for the zone apex) in Punycode.",
222222
Computed: true,
223223
},
224+
"ttl": schema.Float64Attribute{
225+
Description: "Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.",
226+
Computed: true,
227+
},
224228
"type": schema.StringAttribute{
225229
Description: "Record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"MX\", \"NS\", \"OPENPGPKEY\", \"PTR\", \"TXT\", \"CAA\", \"CERT\", \"DNSKEY\", \"DS\", \"HTTPS\", \"LOC\", \"NAPTR\", \"SMIMEA\", \"SRV\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".",
226230
Computed: true,
@@ -287,10 +291,6 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema {
287291
CustomType: customfield.NewListType[types.String](ctx),
288292
ElementType: types.StringType,
289293
},
290-
"ttl": schema.Float64Attribute{
291-
Description: "Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.",
292-
Computed: true,
293-
},
294294
"id": schema.StringAttribute{
295295
Description: "Identifier.",
296296
Computed: true,

0 commit comments

Comments
 (0)