Skip to content

Commit

Permalink
Implements missing attribute. Adds documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskweber authored and issyl0 committed Oct 17, 2021
1 parent a18a1bc commit 5fc1fd6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/data-sources/improvmx_domain_check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `improvmx_domain_check` Data Source

A data source to read domain check status.

## Example Usage

```hcl
data "improvmx_domain_check" "example_com" {
domain = "example.com"
}
```

## Argument Reference

* `domain` - (Required) Name of the domain.

## Attribute Reference

* `id` - (int) Unique ID
* `domain` - (string) Name of the domain
* `records_are_valid` - (bool) Whether all records are valid or not
* `record_mx_is_valid` - (bool) Whether mx record is valid or not
* `record_mx_expected_values` - (list) Expected mx records
* `record_mx_actual_values` - (list) Actual mx records
* `record_spf_is_valid` - (bool) Whether spf record is valid or not
* `record_spf_expected_value` - (list) Expected spf record
* `record_spf_actual_value` - (list) Actual spf record
6 changes: 6 additions & 0 deletions improvmx/data_source_domain_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ func DataSourceDomainCheck() *schema.Resource {
Required: true,
Computed: false,
},
"records_are_valid": {
Type: schema.TypeBool,
Computed: true,
},
"record_mx_is_valid": {
Type: schema.TypeBool,
Computed: true,
Expand Down Expand Up @@ -79,6 +83,8 @@ func dataSourceDomainCheckRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("HTTP response code %d, error text: %s", response.Code, response.Error)
}

d.Set("records_are_valid", response.Records.Valid)

d.Set("record_mx_is_valid", response.Records.Mx.Valid)
d.Set("record_mx_expected_values", response.Records.Mx.Expected)
d.Set("record_mx_actual_values", response.Records.Mx.Values)
Expand Down

0 comments on commit 5fc1fd6

Please sign in to comment.