Skip to content

Commit 9e392da

Browse files
committed
docs: Fixup examples for the Terraform Registry - define params etc.
1 parent 54fe05b commit 9e392da

File tree

4 files changed

+86
-34
lines changed

4 files changed

+86
-34
lines changed

docs/example.tf

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/index.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
# terraform-provider-improvmx
1+
# ImprovMX Terraform Provider
22

3-
A very nascent Terraform provider for configuring [ImprovMX](https://improvmx.com) email forwards. Uses my [ImprovMX Golang API client](https://github.com/issyl0/go-improvmx). Download from the [Terraform Registry](https://registry.terraform.io/providers/issyl0/improvmx/latest).
3+
A community Terraform provider for configuring [ImprovMX](https://improvmx.com) domains and their email forwarding rules.
44

5-
## Features
5+
## Example Usage
66

7-
- Create a domain (ImprovMX creates a wildcard forward for a domain by default).
8-
- Update a domain (to add/remove whitelabel (Enterprise plans only) and notification email settings).
9-
- Delete a domain.
10-
- Import a domain.
11-
- Create an email forward.
12-
- Delete an email forward.
13-
- Import an email forward.
14-
- Update an email forward (ImprovMX allows updating an email forward to send to more than one address, ie `[email protected],[email protected]`).
7+
```hcl
8+
terraform {
9+
required_providers {
10+
improvmx = {
11+
source = "issyl0/improvmx"
12+
version = "0.1.0"
13+
}
14+
}
15+
}
16+
17+
provider "improvmx" {
18+
token = "YOUR API TOKEN HERE"
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
* `token` - ImprovMX API token, alternatively set the `IMPROVMX_API_TOKEN` environment variable.

docs/resources/improvmx_domain.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# `improvmx_domain` Resource
2+
3+
A resource to create ImprovMX domains.
4+
5+
## Example Usage
6+
7+
```hcl
8+
// ImprovMX creates a wildcard email forward on each domain by default.
9+
resource "improvmx_domain" "example" {
10+
domain = "example.com"
11+
}
12+
```
13+
14+
## Argument Reference
15+
16+
* `domain` - (Required) Name of the domain.
17+
* `notification_email` - (Optional) Email to send notifications to.
18+
* `whitelabel` - (Optional) Parent domain that will be displayed for the DNS settings. Only available on the Enterprise plan.
19+
20+
## Import
21+
22+
Domains can be imported using their name, for example:
23+
24+
```shell
25+
$ terraform import improvmx_domain.example example.com
26+
```
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# `improvmx_email_forward` Resource
2+
3+
A resource to create ImprovMX email forwards.
4+
5+
## Example Usage
6+
7+
### Single recipient
8+
9+
```hcl
10+
resource "improvmx_email_forward" "example" {
11+
domain = "example.com"
12+
alias_name = "reception"
13+
destination_email = "[email protected]"
14+
}
15+
```
16+
17+
### Multiple recipients
18+
19+
```hcl
20+
resource "improvmx_email_forward" "sales" {
21+
domain = "example.com"
22+
alias_name = "sales"
23+
destination_email = "[email protected],[email protected]"
24+
}
25+
```
26+
27+
## Argument Reference
28+
29+
* `domain` - (Required) Name of the domain.
30+
* `alias_name` - (Required) Alias to be used in front of your domain, like "contact", "info", etc.
31+
* `destination_email` - (Required) Email address to forward to.
32+
33+
## Import
34+
35+
Email forwards can be imported using their name, for example:
36+
37+
```shell
38+
$ terraform import improvmx_email_forward.example example.com_hello
39+
```

0 commit comments

Comments
 (0)