Skip to content

Commit 5fc1fd6

Browse files
andreaskweberissyl0
authored andcommitted
Implements missing attribute. Adds documentation.
1 parent a18a1bc commit 5fc1fd6

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# `improvmx_domain_check` Data Source
2+
3+
A data source to read domain check status.
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "improvmx_domain_check" "example_com" {
9+
domain = "example.com"
10+
}
11+
```
12+
13+
## Argument Reference
14+
15+
* `domain` - (Required) Name of the domain.
16+
17+
## Attribute Reference
18+
19+
* `id` - (int) Unique ID
20+
* `domain` - (string) Name of the domain
21+
* `records_are_valid` - (bool) Whether all records are valid or not
22+
* `record_mx_is_valid` - (bool) Whether mx record is valid or not
23+
* `record_mx_expected_values` - (list) Expected mx records
24+
* `record_mx_actual_values` - (list) Actual mx records
25+
* `record_spf_is_valid` - (bool) Whether spf record is valid or not
26+
* `record_spf_expected_value` - (list) Expected spf record
27+
* `record_spf_actual_value` - (list) Actual spf record

improvmx/data_source_domain_check.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ func DataSourceDomainCheck() *schema.Resource {
1616
Required: true,
1717
Computed: false,
1818
},
19+
"records_are_valid": {
20+
Type: schema.TypeBool,
21+
Computed: true,
22+
},
1923
"record_mx_is_valid": {
2024
Type: schema.TypeBool,
2125
Computed: true,
@@ -79,6 +83,8 @@ func dataSourceDomainCheckRead(d *schema.ResourceData, meta interface{}) error {
7983
return fmt.Errorf("HTTP response code %d, error text: %s", response.Code, response.Error)
8084
}
8185

86+
d.Set("records_are_valid", response.Records.Valid)
87+
8288
d.Set("record_mx_is_valid", response.Records.Mx.Valid)
8389
d.Set("record_mx_expected_values", response.Records.Mx.Expected)
8490
d.Set("record_mx_actual_values", response.Records.Mx.Values)

0 commit comments

Comments
 (0)