diff --git a/Taskfile.yaml b/Taskfile.yaml index e862a7e1..7c6df7d5 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -52,18 +52,11 @@ tasks: desc: Generate Terraform documentation silent: true cmds: - - cmd: rm -rf docs/terraform/* - cmd: | find terraform -type d -exec test -e '{}/main.tf' -a -e '{}/variables.tf' \; -print | while read -r dir; do if [[ "$dir" == *"/modules/"* ]]; then continue fi - rel_path="${dir#terraform/}" - output_file="docs/terraform/$rel_path.md" - mkdir -p "$(dirname "$output_file")" - if [ -f "$dir/README.md" ]; then - cat "$dir/README.md" > "$output_file" - echo >> "$output_file" - fi - docker run --rm -v "$(pwd):/src" -w "/src/$dir" quay.io/terraform-docs/terraform-docs:0.20.0 markdown . >> "$output_file" + echo "Generating docs for $dir" + docker run --rm -v "$(pwd):/src" -w "/src/$dir" quay.io/terraform-docs/terraform-docs:0.20.0 markdown table --output-file README.md --output-mode inject . done diff --git a/docs/terraform/cluster/azure-aks.md b/docs/terraform/cluster/azure-aks.md deleted file mode 100644 index 06e23dc3..00000000 --- a/docs/terraform/cluster/azure-aks.md +++ /dev/null @@ -1,99 +0,0 @@ -# Azure AKS Module - -This module creates an Azure Kubernetes Service (AKS) cluster with configurable node pools, networking, and security settings. - -## Prerequisites - -The following features must be enabled in your Azure subscription before using this module: - -- EncryptionAtHost feature for Microsoft.Compute provider - ```bash - az feature register --namespace Microsoft.Compute --name EncryptionAtHost - az provider register --namespace Microsoft.Compute - ``` - -### Subscription Requirements - -This module requires a paid Azure subscription. Free tier subscriptions are not supported due to: -- Insufficient vCPU quotas -- Restricted VM sizes -- Limited node pool operations - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >=1.8 | -| [azurerm](#requirement\_azurerm) | ~> 4.29.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 4.29.0 | -| [local](#provider\_local) | 2.5.3 | -| [random](#provider\_random) | 3.7.2 | -| [time](#provider\_time) | 0.13.1 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_disk_encryption_set.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/disk_encryption_set) | resource | -| [azurerm_key_vault.key_vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault) | resource | -| [azurerm_key_vault_access_policy.key_vault_access_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource | -| [azurerm_key_vault_access_policy.key_vault_access_policy_disk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource | -| [azurerm_key_vault_key.key_vault_key](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key) | resource | -| [azurerm_kubernetes_cluster.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster) | resource | -| [azurerm_kubernetes_cluster_node_pool.autoscaled](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster_node_pool) | resource | -| [azurerm_log_analytics_workspace.aks_logs](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/log_analytics_workspace) | resource | -| [azurerm_resource_group.aks](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | -| [local_file.kube_config](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | -| [random_string.key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [time_static.expiry](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource | -| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source | -| [azurerm_subnet.private](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [auto\_scaler\_profile](#input\_auto\_scaler\_profile) | Configuration for the AKS cluster's auto-scaler |
object({
balance_similar_node_groups = bool
max_graceful_termination_sec = number
scale_down_delay_after_add = string
scale_down_delay_after_delete = string
scale_down_delay_after_failure = string
scan_interval = string
scale_down_unneeded = string
scale_down_unready = string
scale_down_utilization_threshold = string
})
|
{
"balance_similar_node_groups": true,
"max_graceful_termination_sec": 600,
"scale_down_delay_after_add": "10m",
"scale_down_delay_after_delete": "10s",
"scale_down_delay_after_failure": "3m",
"scale_down_unneeded": "10m",
"scale_down_unready": "20m",
"scale_down_utilization_threshold": "0.5",
"scan_interval": "10s"
}
| no | -| [automatic\_upgrade\_channel](#input\_automatic\_upgrade\_channel) | The automatic upgrade channel for the AKS cluster | `string` | `"stable"` | no | -| [autoscaled\_node\_pool](#input\_autoscaled\_node\_pool) | Configuration for the autoscaled node pool |
object({
enabled = bool
name = string
vm_size = string
mode = string
os_disk_type = string
max_pods = number
host_encryption_enabled = bool
min_count = number
max_count = number
})
|
{
"enabled": true,
"host_encryption_enabled": true,
"max_count": 3,
"max_pods": 110,
"min_count": 1,
"mode": "User",
"name": "autoscaled",
"os_disk_type": "Managed",
"vm_size": "Standard_D2s_v3"
}
| no | -| [azure\_policy\_enabled](#input\_azure\_policy\_enabled) | Whether to enable Azure Policy for the AKS cluster | `bool` | `true` | no | -| [cluster\_name](#input\_cluster\_name) | Name of the AKS cluster | `string` | `null` | no | -| [context\_id](#input\_context\_id) | Context ID for the resources | `string` | `null` | no | -| [context\_path](#input\_context\_path) | The path to the context folder, where kubeconfig is stored | `string` | `""` | no | -| [default\_node\_pool](#input\_default\_node\_pool) | Configuration for the default node pool |
object({
name = string
vm_size = string
os_disk_type = string
max_pods = number
host_encryption_enabled = bool
min_count = number
max_count = number
node_count = number
only_critical_addons_enabled = bool
})
|
{
"host_encryption_enabled": true,
"max_count": 3,
"max_pods": 110,
"min_count": 1,
"name": "system",
"node_count": 1,
"only_critical_addons_enabled": true,
"os_disk_type": "Managed",
"vm_size": "Standard_D2s_v3"
}
| no | -| [dns\_service\_ip](#input\_dns\_service\_ip) | IP address for Kubernetes DNS service | `string` | `"10.96.0.10"` | no | -| [endpoint\_private\_access](#input\_endpoint\_private\_access) | Whether to enable private access to the Kubernetes API server | `bool` | `false` | no | -| [expiration\_date](#input\_expiration\_date) | The expiration date for the AKS cluster's key vault | `string` | `null` | no | -| [kubelet\_client\_id](#input\_kubelet\_client\_id) | Client ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | -| [kubelet\_object\_id](#input\_kubelet\_object\_id) | Object ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | -| [kubelet\_user\_assigned\_identity\_id](#input\_kubelet\_user\_assigned\_identity\_id) | Resource ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | -| [kubernetes\_version](#input\_kubernetes\_version) | Version of Kubernetes to use | `string` | `"1.32"` | no | -| [local\_account\_disabled](#input\_local\_account\_disabled) | Whether to disable local accounts for the AKS cluster | `bool` | `false` | no | -| [name](#input\_name) | Name of the resource | `string` | `"cluster"` | no | -| [network\_acls\_default\_action](#input\_network\_acls\_default\_action) | The default action for the AKS cluster's network ACLs | `string` | `"Allow"` | no | -| [private\_cluster\_enabled](#input\_private\_cluster\_enabled) | Whether to enable private cluster for the AKS cluster | `bool` | `false` | no | -| [public\_network\_access\_enabled](#input\_public\_network\_access\_enabled) | Whether to enable public network access for the AKS cluster | `bool` | `true` | no | -| [region](#input\_region) | Region for the resources | `string` | `"eastus"` | no | -| [resource\_group\_name](#input\_resource\_group\_name) | Name of the resource group | `string` | `null` | no | -| [role\_based\_access\_control\_enabled](#input\_role\_based\_access\_control\_enabled) | Whether to enable role-based access control for the AKS cluster | `bool` | `true` | no | -| [service\_cidr](#input\_service\_cidr) | CIDR block for Kubernetes services | `string` | `"10.96.0.0/16"` | no | -| [sku\_tier](#input\_sku\_tier) | The SKU tier for the AKS cluster | `string` | `"Standard"` | no | -| [soft\_delete\_retention\_days](#input\_soft\_delete\_retention\_days) | The number of days to retain the AKS cluster's key vault | `number` | `7` | no | -| [tags](#input\_tags) | Tags to apply to the resources | `map(string)` | `{}` | no | -| [user\_assigned\_identity\_ids](#input\_user\_assigned\_identity\_ids) | User assigned identity IDs for the AKS cluster. If provided, the cluster will use only user-assigned identities. | `list(string)` | `[]` | no | -| [vnet\_module\_name](#input\_vnet\_module\_name) | Name on the VNET module | `string` | `"network"` | no | -| [vnet\_subnet\_id](#input\_vnet\_subnet\_id) | ID of the subnet | `string` | `null` | no | -| [workload\_autoscaler\_profile](#input\_workload\_autoscaler\_profile) | Configuration for the AKS cluster's workload autoscaler |
object({
keda_enabled = bool
vertical_pod_autoscaler_enabled = bool
})
|
{
"keda_enabled": false,
"vertical_pod_autoscaler_enabled": false
}
| no | - -## Outputs - -No outputs. diff --git a/terraform/.terraform-docs.yml b/terraform/.terraform-docs.yml index 9398045f..8c76f9fa 100644 --- a/terraform/.terraform-docs.yml +++ b/terraform/.terraform-docs.yml @@ -1,4 +1,4 @@ -formatter: markdown +formatter: markdown table recursive: enabled: true @@ -7,7 +7,6 @@ recursive: sections: show: - - header - requirements - providers - inputs @@ -15,8 +14,6 @@ sections: - resources content: |- - {{ .Header }} - {{ .Requirements }} {{ .Providers }} @@ -28,8 +25,8 @@ content: |- {{ .Resources }} output: - file: "docs/terraform/{{ dir .Path }}/{{ .Name }}.md" - mode: replace + file: "README.md" + mode: inject settings: anchor: true diff --git a/docs/terraform/backend/azurerm.md b/terraform/backend/azurerm/README.md similarity index 98% rename from docs/terraform/backend/azurerm.md rename to terraform/backend/azurerm/README.md index 4771b8d0..b870ee8b 100644 --- a/docs/terraform/backend/azurerm.md +++ b/terraform/backend/azurerm/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -44,3 +45,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file diff --git a/docs/terraform/backend/s3.md b/terraform/backend/s3/README.md similarity index 98% rename from docs/terraform/backend/s3.md rename to terraform/backend/s3/README.md index ace85338..05faebaa 100644 --- a/docs/terraform/backend/s3.md +++ b/terraform/backend/s3/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -51,3 +52,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file diff --git a/docs/terraform/cluster/aws-eks.md b/terraform/cluster/aws-eks/README.md similarity index 99% rename from docs/terraform/cluster/aws-eks.md rename to terraform/cluster/aws-eks/README.md index 5efdd996..e1f5b784 100644 --- a/docs/terraform/cluster/aws-eks.md +++ b/terraform/cluster/aws-eks/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -77,3 +78,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file diff --git a/terraform/cluster/azure-aks/README.md b/terraform/cluster/azure-aks/README.md index 59681b6b..64ae510b 100644 --- a/terraform/cluster/azure-aks/README.md +++ b/terraform/cluster/azure-aks/README.md @@ -18,3 +18,84 @@ This module requires a paid Azure subscription. Free tier subscriptions are not - Insufficient vCPU quotas - Restricted VM sizes - Limited node pool operations + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >=1.8 | +| [azurerm](#requirement\_azurerm) | ~> 4.29.0 | + +## Providers + +| Name | Version | +|------|---------| +| [azurerm](#provider\_azurerm) | 4.29.0 | +| [local](#provider\_local) | 2.5.3 | +| [random](#provider\_random) | 3.7.2 | +| [time](#provider\_time) | 0.13.1 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [azurerm_disk_encryption_set.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/disk_encryption_set) | resource | +| [azurerm_key_vault.key_vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault) | resource | +| [azurerm_key_vault_access_policy.key_vault_access_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource | +| [azurerm_key_vault_access_policy.key_vault_access_policy_disk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource | +| [azurerm_key_vault_key.key_vault_key](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key) | resource | +| [azurerm_kubernetes_cluster.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster) | resource | +| [azurerm_kubernetes_cluster_node_pool.autoscaled](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster_node_pool) | resource | +| [azurerm_log_analytics_workspace.aks_logs](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/log_analytics_workspace) | resource | +| [azurerm_resource_group.aks](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | +| [local_file.kube_config](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | +| [random_string.key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | +| [time_static.expiry](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource | +| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source | +| [azurerm_subnet.private](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [auto\_scaler\_profile](#input\_auto\_scaler\_profile) | Configuration for the AKS cluster's auto-scaler |
object({
balance_similar_node_groups = bool
max_graceful_termination_sec = number
scale_down_delay_after_add = string
scale_down_delay_after_delete = string
scale_down_delay_after_failure = string
scan_interval = string
scale_down_unneeded = string
scale_down_unready = string
scale_down_utilization_threshold = string
})
|
{
"balance_similar_node_groups": true,
"max_graceful_termination_sec": 600,
"scale_down_delay_after_add": "10m",
"scale_down_delay_after_delete": "10s",
"scale_down_delay_after_failure": "3m",
"scale_down_unneeded": "10m",
"scale_down_unready": "20m",
"scale_down_utilization_threshold": "0.5",
"scan_interval": "10s"
}
| no | +| [automatic\_upgrade\_channel](#input\_automatic\_upgrade\_channel) | The automatic upgrade channel for the AKS cluster | `string` | `"stable"` | no | +| [autoscaled\_node\_pool](#input\_autoscaled\_node\_pool) | Configuration for the autoscaled node pool |
object({
enabled = bool
name = string
vm_size = string
mode = string
os_disk_type = string
max_pods = number
host_encryption_enabled = bool
min_count = number
max_count = number
})
|
{
"enabled": true,
"host_encryption_enabled": true,
"max_count": 3,
"max_pods": 110,
"min_count": 1,
"mode": "User",
"name": "autoscaled",
"os_disk_type": "Managed",
"vm_size": "Standard_D2s_v3"
}
| no | +| [azure\_policy\_enabled](#input\_azure\_policy\_enabled) | Whether to enable Azure Policy for the AKS cluster | `bool` | `true` | no | +| [cluster\_name](#input\_cluster\_name) | Name of the AKS cluster | `string` | `null` | no | +| [context\_id](#input\_context\_id) | Context ID for the resources | `string` | `null` | no | +| [context\_path](#input\_context\_path) | The path to the context folder, where kubeconfig is stored | `string` | `""` | no | +| [default\_node\_pool](#input\_default\_node\_pool) | Configuration for the default node pool |
object({
name = string
vm_size = string
os_disk_type = string
max_pods = number
host_encryption_enabled = bool
min_count = number
max_count = number
node_count = number
only_critical_addons_enabled = bool
})
|
{
"host_encryption_enabled": true,
"max_count": 3,
"max_pods": 110,
"min_count": 1,
"name": "system",
"node_count": 1,
"only_critical_addons_enabled": true,
"os_disk_type": "Managed",
"vm_size": "Standard_D2s_v3"
}
| no | +| [dns\_service\_ip](#input\_dns\_service\_ip) | IP address for Kubernetes DNS service | `string` | `"10.96.0.10"` | no | +| [endpoint\_private\_access](#input\_endpoint\_private\_access) | Whether to enable private access to the Kubernetes API server | `bool` | `false` | no | +| [expiration\_date](#input\_expiration\_date) | The expiration date for the AKS cluster's key vault | `string` | `null` | no | +| [kubelet\_client\_id](#input\_kubelet\_client\_id) | Client ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | +| [kubelet\_object\_id](#input\_kubelet\_object\_id) | Object ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | +| [kubelet\_user\_assigned\_identity\_id](#input\_kubelet\_user\_assigned\_identity\_id) | Resource ID of the user-assigned identity to use for the kubelet. If not provided, the cluster will use the system-assigned identity. | `string` | `null` | no | +| [kubernetes\_version](#input\_kubernetes\_version) | Version of Kubernetes to use | `string` | `"1.32"` | no | +| [local\_account\_disabled](#input\_local\_account\_disabled) | Whether to disable local accounts for the AKS cluster | `bool` | `false` | no | +| [name](#input\_name) | Name of the resource | `string` | `"cluster"` | no | +| [network\_acls\_default\_action](#input\_network\_acls\_default\_action) | The default action for the AKS cluster's network ACLs | `string` | `"Allow"` | no | +| [private\_cluster\_enabled](#input\_private\_cluster\_enabled) | Whether to enable private cluster for the AKS cluster | `bool` | `false` | no | +| [public\_network\_access\_enabled](#input\_public\_network\_access\_enabled) | Whether to enable public network access for the AKS cluster | `bool` | `true` | no | +| [region](#input\_region) | Region for the resources | `string` | `"eastus"` | no | +| [resource\_group\_name](#input\_resource\_group\_name) | Name of the resource group | `string` | `null` | no | +| [role\_based\_access\_control\_enabled](#input\_role\_based\_access\_control\_enabled) | Whether to enable role-based access control for the AKS cluster | `bool` | `true` | no | +| [service\_cidr](#input\_service\_cidr) | CIDR block for Kubernetes services | `string` | `"10.96.0.0/16"` | no | +| [sku\_tier](#input\_sku\_tier) | The SKU tier for the AKS cluster | `string` | `"Standard"` | no | +| [soft\_delete\_retention\_days](#input\_soft\_delete\_retention\_days) | The number of days to retain the AKS cluster's key vault | `number` | `7` | no | +| [tags](#input\_tags) | Tags to apply to the resources | `map(string)` | `{}` | no | +| [user\_assigned\_identity\_ids](#input\_user\_assigned\_identity\_ids) | User assigned identity IDs for the AKS cluster. If provided, the cluster will use only user-assigned identities. | `list(string)` | `[]` | no | +| [vnet\_module\_name](#input\_vnet\_module\_name) | Name on the VNET module | `string` | `"network"` | no | +| [vnet\_subnet\_id](#input\_vnet\_subnet\_id) | ID of the subnet | `string` | `null` | no | +| [workload\_autoscaler\_profile](#input\_workload\_autoscaler\_profile) | Configuration for the AKS cluster's workload autoscaler |
object({
keda_enabled = bool
vertical_pod_autoscaler_enabled = bool
})
|
{
"keda_enabled": false,
"vertical_pod_autoscaler_enabled": false
}
| no | + +## Outputs + +No outputs. + diff --git a/docs/terraform/cluster/talos.md b/terraform/cluster/talos/README.md similarity index 99% rename from docs/terraform/cluster/talos.md rename to terraform/cluster/talos/README.md index 0a4e1810..17ea26db 100644 --- a/docs/terraform/cluster/talos.md +++ b/terraform/cluster/talos/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -51,3 +52,4 @@ ## Outputs No outputs. + \ No newline at end of file diff --git a/docs/terraform/gitops/flux.md b/terraform/gitops/flux/README.md similarity index 98% rename from docs/terraform/gitops/flux.md rename to terraform/gitops/flux/README.md index 66197141..575cdbe1 100644 --- a/docs/terraform/gitops/flux.md +++ b/terraform/gitops/flux/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -43,3 +44,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file diff --git a/docs/terraform/network/aws-vpc.md b/terraform/network/aws-vpc/README.md similarity index 99% rename from docs/terraform/network/aws-vpc.md rename to terraform/network/aws-vpc/README.md index 42d8d2ce..33604889 100644 --- a/docs/terraform/network/aws-vpc.md +++ b/terraform/network/aws-vpc/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -65,3 +66,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file diff --git a/docs/terraform/network/azure-vnet.md b/terraform/network/azure-vnet/README.md similarity index 98% rename from docs/terraform/network/azure-vnet.md rename to terraform/network/azure-vnet/README.md index 00a81db1..d6280cfc 100644 --- a/docs/terraform/network/azure-vnet.md +++ b/terraform/network/azure-vnet/README.md @@ -1,3 +1,4 @@ + ## Requirements | Name | Version | @@ -47,3 +48,4 @@ No modules. ## Outputs No outputs. + \ No newline at end of file