From 7fd8797b911add41aa4111f316e73b3ca5394aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brauer?= Date: Fri, 2 Aug 2024 15:59:36 +0200 Subject: [PATCH] docs(acme): generate documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Brauer --- .../virtual_environment_acme_account.md | 52 +++++++++++++++++++ .../virtual_environment_acme_accounts.md | 29 +++++++++++ .../virtual_environment_acme_account.md | 52 +++++++++++++++++++ tools/tools.go | 3 ++ 4 files changed, 136 insertions(+) create mode 100644 docs/data-sources/virtual_environment_acme_account.md create mode 100644 docs/data-sources/virtual_environment_acme_accounts.md create mode 100644 docs/resources/virtual_environment_acme_account.md diff --git a/docs/data-sources/virtual_environment_acme_account.md b/docs/data-sources/virtual_environment_acme_account.md new file mode 100644 index 000000000..e15b0d91a --- /dev/null +++ b/docs/data-sources/virtual_environment_acme_account.md @@ -0,0 +1,52 @@ +--- +layout: page +title: proxmox_virtual_environment_acme_account +parent: Data Sources +subcategory: Virtual Environment +description: |- + Retrieves information about a specific ACME account. +--- + +# Data Source: proxmox_virtual_environment_acme_account + +Retrieves information about a specific ACME account. + +## Example Usage + +```terraform +// This will fetch all ACME accounts... +data "proxmox_virtual_environment_acme_accounts" "all" {} + +// ...which we will go through in order to fetch the whole data on each account. +data "proxmox_virtual_environment_acme_account" "example" { + for_each = data.proxmox_virtual_environment_acme_accounts.all.accounts + name = each.value +} + +output "data_proxmox_virtual_environment_acme_account" { + value = data.proxmox_virtual_environment_acme_account.example +} +``` + + +## Schema + +### Optional + +- `name` (String) The identifier of the ACME account to read. + +### Read-Only + +- `account` (Attributes) The ACME account information. (see [below for nested schema](#nestedatt--account)) +- `directory` (String) The directory URL of the ACME account. +- `location` (String) The location URL of the ACME account. +- `tos` (String) The URL of the terms of service of the ACME account. + + +### Nested Schema for `account` + +Read-Only: + +- `contact` (List of String) An array of contact email addresses. +- `created_at` (String) The timestamp of the account creation. +- `status` (String) The status of the account. Can be one of 'valid', 'deactivated' or 'revoked'. diff --git a/docs/data-sources/virtual_environment_acme_accounts.md b/docs/data-sources/virtual_environment_acme_accounts.md new file mode 100644 index 000000000..c550807e8 --- /dev/null +++ b/docs/data-sources/virtual_environment_acme_accounts.md @@ -0,0 +1,29 @@ +--- +layout: page +title: proxmox_virtual_environment_acme_accounts +parent: Data Sources +subcategory: Virtual Environment +description: |- + Retrieves the list of ACME accounts. +--- + +# Data Source: proxmox_virtual_environment_acme_accounts + +Retrieves the list of ACME accounts. + +## Example Usage + +```terraform +data "proxmox_virtual_environment_acme_accounts" "example" {} + +output "data_proxmox_virtual_environment_acme_accounts" { + value = data.proxmox_virtual_environment_acme_accounts.example.accounts +} +``` + + +## Schema + +### Read-Only + +- `accounts` (Set of String) The identifiers of the ACME accounts. diff --git a/docs/resources/virtual_environment_acme_account.md b/docs/resources/virtual_environment_acme_account.md new file mode 100644 index 000000000..9742d7362 --- /dev/null +++ b/docs/resources/virtual_environment_acme_account.md @@ -0,0 +1,52 @@ +--- +layout: page +title: proxmox_virtual_environment_acme_account +parent: Resources +subcategory: Virtual Environment +description: |- + Manages an ACME account in a Proxmox VE cluster. +--- + +# Resource: proxmox_virtual_environment_acme_account + +Manages an ACME account in a Proxmox VE cluster. + +## Example Usage + +```terraform +resource "proxmox_virtual_environment_acme_account" "example" { + name = "example" + contact = "example@email.com" + directory = "https://acme-staging-v02.api.letsencrypt.org/directory" + tos = "https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf" +} +``` + + +## Schema + +### Required + +- `contact` (String) The contact email addresses. + +### Optional + +- `directory` (String) The URL of the ACME CA directory endpoint. +- `eab_hmac_key` (String) The HMAC key for External Account Binding. +- `eab_kid` (String) The Key Identifier for External Account Binding. +- `name` (String) The ACME account config file name. +- `tos` (String) The URL of CA TermsOfService - setting this indicates agreement. + +### Read-Only + +- `location` (String) The location of the ACME account. + +## Import + +Import is supported using the following syntax: + +```shell +#!/usr/bin/env sh +# ACME accounts can be imported using their name, e.g.: +terraform import proxmox_virtual_environment_acme_account.example example +``` diff --git a/tools/tools.go b/tools/tools.go index 4809769a7..d6744e9e9 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -28,6 +28,8 @@ import ( // Temporary: while migrating to the TF framework, we need to copy the generated docs to the right place // for the resources / data sources that have been migrated. //go:generate cp -R ../build/docs-gen/guides/. ../docs/guides/ +//go:generate cp ../build/docs-gen/data-sources/virtual_environment_acme_account.md ../docs/data-sources/ +//go:generate cp ../build/docs-gen/data-sources/virtual_environment_acme_accounts.md ../docs/data-sources/ //go:generate cp ../build/docs-gen/data-sources/virtual_environment_apt_repository.md ../docs/data-sources/ //go:generate cp ../build/docs-gen/data-sources/virtual_environment_apt_standard_repository.md ../docs/data-sources/ //go:generate cp ../build/docs-gen/data-sources/virtual_environment_hagroup.md ../docs/data-sources/ @@ -40,6 +42,7 @@ import ( //go:generate cp ../build/docs-gen/data-sources/virtual_environment_version.md ../docs/data-sources/ //go:generate cp ../build/docs-gen/data-sources/virtual_environment_vm2.md ../docs/data-sources/ //go:generate cp ../build/docs-gen/resources/virtual_environment_acl.md ../docs/resources/ +//go:generate cp ../build/docs-gen/resources/virtual_environment_acme_account.md ../docs/resources/ //go:generate cp ../build/docs-gen/resources/virtual_environment_apt_repository.md ../docs/resources/ //go:generate cp ../build/docs-gen/resources/virtual_environment_apt_standard_repository.md ../docs/resources/ //go:generate cp ../build/docs-gen/resources/virtual_environment_cluster_options.md ../docs/resources/