|
1 | | ---- |
2 | | -subcategory: "Transactional Email" |
3 | | -page_title: "Scaleway: scaleway_tem_domain" |
4 | | ---- |
5 | | - |
6 | | -# Resource: scaleway_tem_domain |
7 | | - |
8 | | -Creates and manages Scaleway Transactional Email Domains. |
9 | | -For more information refer to the [API documentation](https://www.scaleway.com/en/developers/api/transactional-email). |
10 | | - |
11 | | -## Example Usage |
12 | | - |
13 | | -### Basic |
14 | | - |
15 | | -```terraform |
16 | | -resource "scaleway_tem_domain" "main" { |
17 | | - accept_tos = true |
18 | | - name = "example.com" |
19 | | -} |
20 | | -``` |
21 | | - |
22 | | -### Add the required records to your DNS zone |
23 | | - |
24 | | -```terraform |
25 | | -variable "domain_name" { |
26 | | - type = string |
27 | | -} |
28 | | -
|
29 | | -resource "scaleway_tem_domain" "main" { |
30 | | - name = var.domain_name |
31 | | - accept_tos = true |
32 | | -} |
33 | | -
|
34 | | -resource "scaleway_domain_record" "spf" { |
35 | | - dns_zone = var.domain_name |
36 | | - type = "TXT" |
37 | | - data = "v=spf1 ${scaleway_tem_domain.main.spf_config} -all" |
38 | | -} |
39 | | -
|
40 | | -resource "scaleway_domain_record" "dkim" { |
41 | | - dns_zone = var.domain_name |
42 | | - name = "${scaleway_tem_domain.main.project_id}._domainkey" |
43 | | - type = "TXT" |
44 | | - data = scaleway_tem_domain.main.dkim_config |
45 | | -} |
46 | | -
|
47 | | -resource "scaleway_domain_record" "mx" { |
48 | | - dns_zone = var.domain_name |
49 | | - type = "MX" |
50 | | - data = "." |
51 | | -} |
52 | | -
|
53 | | -resource "scaleway_domain_record" "dmarc" { |
54 | | - dns_zone = var.domain_name |
55 | | - name = scaleway_tem_domain.main.dmarc_name |
56 | | - type = "TXT" |
57 | | - data = scaleway_tem_domain.main.dmarc_config |
58 | | -} |
59 | | -``` |
60 | | - |
61 | | -### Automatically Configure DNS Settings for Your Domain |
62 | | - |
63 | | -```terraform |
64 | | -variable "domain_name" { |
65 | | - type = string |
66 | | -} |
67 | | -
|
68 | | -resource "scaleway_tem_domain" "main" { |
69 | | - name = var.domain_name |
70 | | - accept_tos = true |
71 | | - autoconfig = true |
72 | | -} |
73 | | -
|
74 | | -``` |
75 | | - |
76 | | -### Configuring GitLab Project Variables |
77 | | - |
78 | | -```terraform |
79 | | -
|
80 | | -variable "domain_name" { |
81 | | - type = string |
82 | | -} |
83 | | -
|
84 | | -data "scaleway_tem_domain" "my_domain" { |
85 | | - name = var.domain_name |
86 | | -} |
87 | | -
|
88 | | -resource "gitlab_project_variable" "smtp_host" { |
89 | | - key = "SMTP_AUTH_USER" |
90 | | - value = data.scaleway_tem_domain.my_domain.smtps_auth_user |
91 | | -} |
92 | | -
|
93 | | -resource "gitlab_project_variable" "smtp_port" { |
94 | | - key = "SMTP_PORT" |
95 | | - value = data.scaleway_tem_domain.my_domain.smtps_port |
96 | | -} |
97 | | -
|
98 | | -resource "gitlab_project_variable" "smtp_host" { |
99 | | - key = "SMTP_HOST" |
100 | | - value = data.scaleway_tem_domain.my_domain.smtps_host |
101 | | -} |
102 | | -
|
103 | | -``` |
104 | | - |
105 | | -## Argument Reference |
106 | | - |
107 | | -The following arguments are supported: |
108 | | - |
109 | | -- `name` - (Required) The domain name, must not be used in another Transactional Email Domain. |
110 | | - ~> **Important:** Updates to `name` will recreate the domain. |
111 | | - |
112 | | -- `accept_tos` - (Required) Acceptation of the [Term of Service](https://tem.s3.fr-par.scw.cloud/antispam_policy.pdf). |
113 | | - ~> **Important:** This attribute must be set to `true`. |
114 | | - |
115 | | -- `region` - (Defaults to [provider](../index.md#region) `region`). The [region](../guides/regions_and_zones.md#regions) in which the domain should be created. |
116 | | - |
117 | | -- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the domain is associated with. |
118 | | - |
119 | | -- `autoconfig` - (Defaults to `false`) Automatically configures DNS settings for the domain, simplifying the setup process by applying predefined configurations. |
120 | | - |
121 | | -## Attributes Reference |
122 | | - |
123 | | -In addition to all arguments above, the following attributes are exported: |
124 | | - |
125 | | -- `id` - The ID of the Transaction Email Domain. |
126 | | - |
127 | | -~> **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` |
128 | | - |
129 | | -- `status` - The status of the Transaction Email Domain. |
130 | | - |
131 | | -- `created_at` - The date and time of the Transaction Email Domain's creation (RFC 3339 format). |
132 | | - |
133 | | -- `next_check_at` - The date and time of the next scheduled check (RFC 3339 format). |
134 | | - |
135 | | -- `last_valid_at` - The date and time the domain was last found to be valid (RFC 3339 format). |
136 | | - |
137 | | -- `revoked_at` - The date and time of the revocation of the domain (RFC 3339 format). |
138 | | - |
139 | | -- `last_error` - (Deprecated) The error message if the last check failed. |
140 | | - |
141 | | -- `spf_config` - The snippet of the SPF record that should be registered in the DNS zone. |
142 | | - |
143 | | -- `dkim_config` - The DKIM public key, as should be recorded in the DNS zone. |
144 | | - |
145 | | -- `dmarc_name` - DMARC name for the domain, as should be recorded in the DNS zone. |
146 | | - |
147 | | -- `dmarc_config` - DMARC record for the domain, as should be recorded in the DNS zone. |
148 | | - |
149 | | -- `smtp_host` - The SMTP host to use to send emails. |
150 | | - |
151 | | -- `smtp_port_unsecure` - The SMTP port to use to send emails. |
152 | | - |
153 | | -- `smtp_port` - The SMTP port to use to send emails over TLS. |
154 | | - |
155 | | -- `smtp_port_alternative` - The SMTP port to use to send emails over TLS. |
156 | | - |
157 | | -- `smtps_port` - The SMTPS port to use to send emails over TLS Wrapper. |
158 | | - |
159 | | -- `smtps_port_alternative` - The SMTPS port to use to send emails over TLS Wrapper. |
160 | | - |
161 | | -- `smtps_auth_user` - SMTPS auth user refers to the identifier for a user authorized to send emails via SMTPS, ensuring secure email transmission. |
162 | | - |
163 | | -- `mx_blackhole` - The Scaleway's blackhole MX server to use if you do not have one. |
164 | | - |
165 | | -- `reputation` - The domain's reputation. |
166 | | - - `status` - The status of the domain's reputation. |
167 | | - - `score` - A range from 0 to 100 that determines your domain's reputation score. |
168 | | - - `scored_at` - The time and date the score was calculated. |
169 | | - - `previous_score` - The previously-calculated domain's reputation score. |
170 | | - - `previous_scored_at` - The time and date the previous reputation score was calculated. |
171 | | - |
172 | | -## Import |
173 | | - |
174 | | -Domains can be imported using the `{region}/{id}`, e.g. |
175 | | - |
176 | | -```bash |
177 | | -terraform import scaleway_tem_domain.main fr-par/11111111-1111-1111-1111-111111111111 |
178 | | -``` |
| 1 | +gi |
0 commit comments