-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from go-gandi/docs
Write documentation
- Loading branch information
Showing
10 changed files
with
244 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ terraform.tfplan | |
.terraform | ||
crash.log | ||
dist | ||
.vscode | ||
|
||
website/vendor | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Data Source: domain | ||
|
||
Use this data source to get the ID of a domain for other resources. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "gandi_domain" "my_domain" { | ||
name = "my.domain" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The FQDN of the domain. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the domain. | ||
* `nameservers` - A list of nameservers for the domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Data Source: livedns_domain_ns | ||
|
||
Use this data source to get the nameservers of a domain for other resources. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "gandi_livedns_domain_ns" "my_domain" { | ||
name = "my.domain" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The FQDN of the domain. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the domain. | ||
* `nameservers` - A list of nameservers for the domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Data Source: livedns_domain | ||
|
||
Use this data source to get the ID of a domain for other resources. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "gandi_livedns_domain" "my_domain" { | ||
name = "my.domain" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The FQDN of the domain. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Gandi Provider | ||
|
||
The Gandi provider enables the purchasing and management of domain names through the [Gandi domain registrar](https://gandi.net). It also supports management of DNS hosting through the LiveDNS service. | ||
|
||
The provider needs to be configured with the proper credentials before it can be used. | ||
|
||
Use the navigation to the left to read about the available resources. | ||
|
||
## Example Usage | ||
|
||
Terraform 0.13 and later: | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
gandi = { | ||
version = "~> 2.0" | ||
source = "go-gandi/gandi" | ||
} | ||
} | ||
} | ||
provider "gandi" { | ||
key = "MY_API_KEY" | ||
} | ||
resource "gandi_domain" "example_com" { | ||
name = "example.com" | ||
nameservers = ["a.dns.server"] | ||
} | ||
``` | ||
|
||
Terraform 0.12: | ||
|
||
```terraform | ||
provider "gandi" { | ||
key = "MY_API_KEY" | ||
} | ||
resource "gandi_domain" "example_com" { | ||
name = "example.com" | ||
nameservers = ["a.dns.server"] | ||
} | ||
``` | ||
|
||
## Authentication | ||
|
||
The Gandi provider supports a couple of different methods for providing authentication credentials. | ||
|
||
You can retrieve your API key by visiting the [Account Management](https://account.gandi.net/en/) screen, going to the `Security` tab and generating your `Production API Key`. | ||
|
||
Optionally, you can provide a Sharing ID to specify an organization. If set, the Sharing ID indicates the organization that will pay for any ordered products, and will filter collections. | ||
|
||
### Static Credentials | ||
|
||
!> Hard-coding credentials into any Terraform configuration is not recommended, and risks leaking secrets should the configuration be committed to public version control. | ||
|
||
Usage: | ||
|
||
```terraform | ||
provider "gandi" { | ||
key = "MY_API_KEY" | ||
sharing_id = "MY_SHARING_ID" | ||
} | ||
``` | ||
|
||
### Environment Variables | ||
|
||
You can provide your credentials via the `GANDI_KEY` and `GANDI_SHARING_ID` environment variables, representing the API Key and the Sharing ID, respectively. | ||
|
||
```terraform | ||
provider "gandi" {} | ||
``` | ||
|
||
Usage: | ||
|
||
```terraform | ||
$ export GANDI_KEY="MY_API_KEY" | ||
$ export GANDI_SHARING_ID="MY_SHARING_ID" | ||
$ terraform plan | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Resource: domain | ||
|
||
The Domain resource enables the creation and management of Domains. | ||
!> Creating a new Domain will result in your account being charged. | ||
~> It is not currently possible to delete Domains via the provider. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "gandi_domain" "my_domain" { | ||
name = "my.domain" | ||
autorenew = "true" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The FQDN of the domain. | ||
* `nameservers` - (Optional) A list of nameservers for the domain. | ||
* `autorenew` - (Optional) Should the domain autorenew? | ||
* `admin` - (Required) Nested block listing the admin details for the domain. See below for the structure of the contact detail blocks. | ||
* `billing` - (Required) Nested block listing the billing details for the domain. See below for the structure of the contact detail blocks. | ||
* `owner` - (Required) Nested block listing the owner details for the domain. See below for the structure of the contact detail blocks. | ||
* `tech` - (Required) Nested block listing the admin details for the domain. See below for the structure of the contact detail blocks. | ||
|
||
Nested contact detail blocks have the following structure: | ||
|
||
* `country` - (Required) The two letter country code for the contact. | ||
* `email` - (Required) The email address of the contact. | ||
* `family_name` - (Required) The family name of the contact. | ||
* `given_name` - (Required) The given name of the contact. | ||
* `street_addr` - (Required) The street address of the contact. | ||
* `type` - (Required) The type of contact. Can be one of `person`, `company`, `association` or `public`. | ||
* `phone` - (Required) The phone number for the contact. | ||
* `city` - (Required) The city the contact is based in. | ||
* `organisation` - (Required unless the `type` is `person`) The legal name of the organisation. | ||
* `zip` - (Required) Postal Code/Zip of the contact. | ||
* `data_obfuscated` - (Optional) Whether to obfuscate contact details in WHOIS. Defaults to `false`. | ||
* `mail_obfuscated` - (Optional) Whether to obfuscate contact email in WHOIS. Defaults to `false`. | ||
* `extra_parameters` - (Optional) Extra parameters, needed for some domain registries. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the resource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Resource: livedns_domain | ||
|
||
The `livedns_domain` resource enables a Domain in the LiveDNS management system. You must enable a domain before adding records to it. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "gandi_livedns_domain" "my_domain" { | ||
name = "my.domain" | ||
ttl = "3600" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Required) The FQDN of the domain. | ||
* `ttl` - (Required) The default TTL of the domain. | ||
* `automatic_snapshots` - (Optional) Enable the automatic creation of snapshots when changes are made. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the resource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Resource: livedns_record | ||
|
||
The `livedns_record` resource creates a record for a domain in the LiveDNS management system. | ||
!> You must enable a domain using the `livedns_domain` resource before adding records to it. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "gandi_livedns_record" "www_my_domain" { | ||
zone = "my.domain" | ||
name = "www" | ||
type = "A" | ||
values = ["127.0.0.2"] | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `zone` - (Required) The FQDN of the domain. | ||
* `name` - (Required) The name of the record. | ||
* `type` - (Required) The type of the record. Can be one of "A", "AAAA", "ALIAS", "CAA", "CDS", "CNAME", "DNAME", "DS", "KEY", "LOC", "MX", "NS", "OPENPGPKEY", "PTR", "SPF", "SRV", "SSHFP", "TLSA", "TXT", "WKS". | ||
* `ttl` - (Required) The TTL of the record. | ||
* `values` - (Required) A list of the values of the record. | ||
|
||
## Attribute Reference | ||
|
||
* `id` - The ID of the resource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters