Skip to content

Commit 99748dd

Browse files
authored
feat(tem): add MX blackhole field (#2198)
1 parent 0d9c1b4 commit 99748dd

File tree

3 files changed

+25
-38
lines changed

3 files changed

+25
-38
lines changed

docs/data-sources/tem_domain.md

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,22 @@ data "scaleway_tem_domain" "my_domain" {
1717
1818
// Get info by domain ID
1919
data "scaleway_tem_domain" "my_domain" {
20-
id = "11111111-1111-1111-1111-111111111111"
20+
domain_id = "11111111-1111-1111-1111-111111111111"
2121
}
2222
```
2323

2424
## Argument Reference
2525

2626
- `name` - (Optional) The domain name.
27-
Only one of `name` and `id` should be specified.
27+
Only one of `name` and `domain_id` should be specified.
2828

29-
- `id` - (Optional) The domain id.
30-
Only one of `name` and `id` should be specified.
29+
- `domain_id` - (Optional) The domain id.
30+
Only one of `name` and `domain_id` should be specified.
3131

3232
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the domain exists.
3333

3434
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the domain is associated with.
3535

3636
## Attributes Reference
3737

38-
In addition to all above arguments, the following attributes are exported:
39-
40-
- `id` - The ID of the Transaction Email Domain.
41-
42-
~> **Important:** Transaction Email Domains' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`
43-
44-
- `status` - The status of the Transaction Email Domain.
45-
46-
- `created_at` - The date and time of the Transaction Email Domain's creation (RFC 3339 format).
47-
48-
- `next_check_at` - The date and time of the next scheduled check (RFC 3339 format).
49-
50-
- `last_valid_at` - The date and time the domain was last found to be valid (RFC 3339 format).
51-
52-
- `revoked_at` - The date and time of the revocation of the domain (RFC 3339 format).
53-
54-
- `last_error` - The error message if the last check failed.
55-
56-
- `spf_config` - The snippet of the SPF record that should be registered in the DNS zone.
57-
58-
- `dkim_config` - The DKIM public key, as should be recorded in the DNS zone.
59-
60-
- `smtp_host` - The SMTP host to use to send emails.
61-
62-
- `smtp_port_unsecure` - The SMTP port to use to send emails.
63-
64-
- `smtp_port` - The SMTP port to use to send emails over TLS.
65-
66-
- `smtp_port_alternative` - The SMTP port to use to send emails over TLS.
67-
68-
- `smtps_port` - The SMTPS port to use to send emails over TLS Wrapper.
69-
70-
- `smtps_port_alternative` - The SMTPS port to use to send emails over TLS Wrapper.
71-
38+
Exported attributes are the ones from `scaleway_tem_domain` [resource](../resources/tem_domain.md)

docs/resources/tem_domain.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@ In addition to all above arguments, the following attributes are exported:
8989

9090
- `dkim_config` - The DKIM public key, as should be recorded in the DNS zone.
9191

92+
- `smtp_host` - The SMTP host to use to send emails.
93+
94+
- `smtp_port_unsecure` - The SMTP port to use to send emails.
95+
96+
- `smtp_port` - The SMTP port to use to send emails over TLS.
97+
98+
- `smtp_port_alternative` - The SMTP port to use to send emails over TLS.
99+
100+
- `smtps_port` - The SMTPS port to use to send emails over TLS Wrapper.
101+
102+
- `smtps_port_alternative` - The SMTPS port to use to send emails over TLS Wrapper.
103+
104+
- `mx_blackhole` - The Scaleway's blackhole MX server to use if you do not have one.
105+
92106
## Import
93107

94108
Domains can be imported using the `{region}/{id}`, e.g.

scaleway/resource_tem_domain.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func resourceScalewayTemDomain() *schema.Resource {
115115
Computed: true,
116116
Description: fmt.Sprintf("SMTPS port to use to send emails over TLS Wrapper. (Port %d)", tem.SMTPSPortAlternative),
117117
},
118+
"mx_blackhole": {
119+
Type: schema.TypeString,
120+
Computed: true,
121+
Description: "The Scaleway's blackhole MX server to use",
122+
},
118123
"region": regionSchema(),
119124
"project_id": projectIDSchema(),
120125
},
@@ -176,6 +181,7 @@ func resourceScalewayTemDomainRead(ctx context.Context, d *schema.ResourceData,
176181
_ = d.Set("smtp_port_alternative", tem.SMTPPortAlternative)
177182
_ = d.Set("smtps_port", tem.SMTPSPort)
178183
_ = d.Set("smtps_port_alternative", tem.SMTPSPortAlternative)
184+
_ = d.Set("mx_blackhole", tem.MXBlackhole)
179185
_ = d.Set("region", string(region))
180186
_ = d.Set("project_id", domain.ProjectID)
181187

0 commit comments

Comments
 (0)