Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninguyot committed Jan 16, 2024
1 parent 783f21c commit 2f22686
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
14 changes: 9 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ The Horizon Provider is used to manage the life cycle of certificates.

## Example Usage

You can authent with credentials.
You can authenticate with credentials

```terraform
provider "horizon" {
x_api_id = "example"
x_api_key = "example"
endpoint = "https://horizon.example"
alias = "with-creds"
endpoint = "https://horizon.example"
username = "example"
password = "example"
}
```

Or with a certificate and a key.
Or with a certificate and a key

```terraform
provider "horizon" {
alias = "with-cert"
endpoint = "https://horizon.company.com"
cert = "----BEGIN CERTIFICATE-----\n...\n----END CERTIFICATE-----\n"
key = "----BEGIN RSA PRIVATE KEY-----\n...\n----END RSA PRIVATE KEY-----"
Expand Down
13 changes: 6 additions & 7 deletions docs/resources/certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description: |-

Provides a Certificate resource. This resource allow you to manage the life cycle of a certificate.

This resource creates and enroll a certificate on Horizon, with centralized or decentralized method.
This resource enrolls a certificate on Horizon, either via centralized or decentralized enrollment.
To enroll with the decentralized method you just need to edit the `csr` argument.
The argument `key_file` is required for a centralized enroll, but forbiden in decentralized enroll.
The argument `key_file` is required for a centralized enroll, but forbidden in decentralized enroll.

## Example Usage

Expand All @@ -20,20 +20,19 @@ The argument `key_file` is required for a centralized enroll, but forbiden in de
```terraform
resource "horizon_certificate" "example" {
subject {
element = "CN"
element = "cn.1"
type = "CN"
value = "example.terraform.cn"
value = "example.org"
}
sans {
element = "DNSNAME"
type = "DNSNAME"
value = "example.terraform.dnsname"
value = ["example.org"]
}
labels {
label = "label"
value = "example"
}
profile = "Enrollment Profile"
profile = "DefaultProfile"
key_type = "rsa-2048"
revoke_on_delete = false
}
Expand Down
2 changes: 2 additions & 0 deletions examples/provider/provider_cert.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
provider "horizon" {
alias = "with-cert"

endpoint = "https://horizon.company.com"
cert = "----BEGIN CERTIFICATE-----\n...\n----END CERTIFICATE-----\n"
key = "----BEGIN RSA PRIVATE KEY-----\n...\n----END RSA PRIVATE KEY-----"
Expand Down
8 changes: 5 additions & 3 deletions examples/provider/provider_creds.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
provider "horizon" {
x_api_id = "example"
x_api_key = "example"
endpoint = "https://horizon.example"
alias = "with-creds"
endpoint = "https://horizon.example"

username = "example"
password = "example"
}

0 comments on commit 2f22686

Please sign in to comment.