From 5a36cc6dd07fc9ca49be61830f3c9d5eea9ea3a1 Mon Sep 17 00:00:00 2001 From: artlvns Date: Fri, 1 Nov 2024 13:32:06 +0100 Subject: [PATCH 1/9] feat: test tf-docs action --- .github/workflows/test.yaml | 2 +- README.md | 48 ------------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5737dd..3f56ec4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ env: jobs: tf: - uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@v0 + uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@tf-docs secrets: inherit permissions: contents: read # required for checkout action. diff --git a/README.md b/README.md index 4646f35..7856b29 100644 --- a/README.md +++ b/README.md @@ -120,51 +120,3 @@ git push --tags # push the new tags ``` **Note:** If you are having problems pulling main after a release, try to force fetch the tags: `git fetch --tags -f`. - -## terraform-docs - - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.8.0, < 2.0.0 | -| [azurerm](#requirement\_azurerm) | >= 3.0.0, < 5.0.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 4.0.1 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_consumption_budget_subscription.sub_budget_consumption](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_subscription) | resource | -| [azurerm_cost_anomaly_alert.sub_cost_anomaly_alert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cost_anomaly_alert) | resource | -| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [app\_short\_name](#input\_app\_short\_name) | Name of app short, used for rg | `string` | n/a | yes | -| [consumption\_budget\_amount](#input\_consumption\_budget\_amount) | The amount of money to be consumed | `number` | n/a | yes | -| [consumption\_budget\_notification\_cfg](#input\_consumption\_budget\_notification\_cfg) | The notification blocks |
map(object({
enabled = optional(bool)
threshold = optional(number)
operator = optional(string)
contact_emails = optional(list(string))
}))
|
{
"notification1": {
"enabled": false
}
}
| no | -| [consumption\_budget\_time\_grain](#input\_consumption\_budget\_time\_grain) | The time grain for the consumption budget | `string` | `"Monthly"` | no | -| [cost\_anomaly\_alert\_email\_receivers](#input\_cost\_anomaly\_alert\_email\_receivers) | The email addresses to receive cost anomaly alerts | `list(string)` | `[]` | no | -| [environment](#input\_environment) | The runtime environment targeted. Development, test, qa, production etc | `string` | n/a | yes | -| [subscription](#input\_subscription) | The subscription | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [consumption\_budget\_id](#output\_consumption\_budget\_id) | value of the consumption budget id | -| [cost\_anomaly\_alert\_id](#output\_cost\_anomaly\_alert\_id) | value of the cost anomaly alert id | - From b0a6cf73e52367aff870376f34fbe12d0004138f Mon Sep 17 00:00:00 2001 From: artlvns Date: Fri, 1 Nov 2024 13:52:57 +0100 Subject: [PATCH 2/9] chore: test with direct input --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f56ec4..f8c4ae9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,4 +28,5 @@ jobs: pull-requests: write # required for commenting on PR with: terraform-version: "1.9.x" - tflint-version: "v0.53.0" \ No newline at end of file + tflint-version: "v0.53.0" + readme-file-path: ${{ github.workspace }} \ No newline at end of file From 393fec8b31a956cde34004a8842dcee7f56b42e3 Mon Sep 17 00:00:00 2001 From: artlvns Date: Fri, 1 Nov 2024 14:05:03 +0100 Subject: [PATCH 3/9] chore: remove path readme from actions --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f8c4ae9..3f56ec4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,5 +28,4 @@ jobs: pull-requests: write # required for commenting on PR with: terraform-version: "1.9.x" - tflint-version: "v0.53.0" - readme-file-path: ${{ github.workspace }} \ No newline at end of file + tflint-version: "v0.53.0" \ No newline at end of file From a95a40b47993fd7ea1cfd372b662976b816d57db Mon Sep 17 00:00:00 2001 From: artlvns Date: Fri, 1 Nov 2024 14:16:17 +0100 Subject: [PATCH 4/9] chore: test input to docs --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f56ec4..b0be3bd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,4 +28,5 @@ jobs: pull-requests: write # required for commenting on PR with: terraform-version: "1.9.x" - tflint-version: "v0.53.0" \ No newline at end of file + tflint-version: "v0.53.0" + readme-file-path: "." \ No newline at end of file From 6602ea6937e8f5a3fe9c49e74104476213f4e14e Mon Sep 17 00:00:00 2001 From: artlvns Date: Fri, 1 Nov 2024 14:34:12 +0100 Subject: [PATCH 5/9] chore: elevate priveleges to wirte on contents --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b0be3bd..c290212 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,7 +23,7 @@ jobs: uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@tf-docs secrets: inherit permissions: - contents: read # required for checkout action. + contents: write # required for checkout action. id-token: write # required for Azre passwodless login pull-requests: write # required for commenting on PR with: From 0b8ad8ad9b286290a8ae522de3a9c0478a26ec33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 1 Nov 2024 13:38:08 +0000 Subject: [PATCH 6/9] terraform-docs: automated action --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 7856b29..8e17ca5 100644 --- a/README.md +++ b/README.md @@ -120,3 +120,49 @@ git push --tags # push the new tags ``` **Note:** If you are having problems pulling main after a release, try to force fetch the tags: `git fetch --tags -f`. + +Below is a placeholder for Terraform-docs generated documentation. Do not edit between the delimiters. +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.8.0, < 2.0.0 | +| [azurerm](#requirement\_azurerm) | >= 3.0.0, < 5.0.0 | + +## Providers + +| Name | Version | +|------|---------| +| [azurerm](#provider\_azurerm) | >= 3.0.0, < 5.0.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [azurerm_consumption_budget_subscription.sub_budget_consumption](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_subscription) | resource | +| [azurerm_cost_anomaly_alert.sub_cost_anomaly_alert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cost_anomaly_alert) | resource | +| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [app\_short\_name](#input\_app\_short\_name) | Name of app short, used for rg | `string` | n/a | yes | +| [consumption\_budget\_amount](#input\_consumption\_budget\_amount) | The amount of money to be consumed | `number` | n/a | yes | +| [consumption\_budget\_notification\_cfg](#input\_consumption\_budget\_notification\_cfg) | The notification blocks |
map(object({
enabled = optional(bool)
threshold = optional(number)
operator = optional(string)
contact_emails = optional(list(string))
}))
|
{
"notification1": {
"enabled": false
}
}
| no | +| [consumption\_budget\_time\_grain](#input\_consumption\_budget\_time\_grain) | The time grain for the consumption budget | `string` | `"Monthly"` | no | +| [cost\_anomaly\_alert\_email\_receivers](#input\_cost\_anomaly\_alert\_email\_receivers) | The email addresses to receive cost anomaly alerts | `list(string)` | `[]` | no | +| [environment](#input\_environment) | The runtime environment targeted. Development, test, qa, production etc | `string` | n/a | yes | +| [subscription](#input\_subscription) | The subscription | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [consumption\_budget\_id](#output\_consumption\_budget\_id) | value of the consumption budget id | +| [cost\_anomaly\_alert\_id](#output\_cost\_anomaly\_alert\_id) | value of the cost anomaly alert id | + From c9b5678b17b103df0a55254d85f8f23849d256d7 Mon Sep 17 00:00:00 2001 From: artlvns Date: Mon, 11 Nov 2024 12:24:03 +0100 Subject: [PATCH 7/9] chore: revert action back to release v0 to test if works as expected. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c290212..3a701d3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ env: jobs: tf: - uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@tf-docs + uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@v0 secrets: inherit permissions: contents: write # required for checkout action. From 37efccf71573e65636ae17c8414fe39ceefd6f3a Mon Sep 17 00:00:00 2001 From: Peder Schmedling <24737456+Laffs2k5@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:55:16 +0100 Subject: [PATCH 8/9] debug: mess up the readme --- README.md | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/README.md b/README.md index 8e17ca5..ea3675c 100644 --- a/README.md +++ b/README.md @@ -124,45 +124,4 @@ git push --tags # push the new tags Below is a placeholder for Terraform-docs generated documentation. Do not edit between the delimiters. ## Requirements -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.8.0, < 2.0.0 | -| [azurerm](#requirement\_azurerm) | >= 3.0.0, < 5.0.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | >= 3.0.0, < 5.0.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_consumption_budget_subscription.sub_budget_consumption](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_subscription) | resource | -| [azurerm_cost_anomaly_alert.sub_cost_anomaly_alert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cost_anomaly_alert) | resource | -| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [app\_short\_name](#input\_app\_short\_name) | Name of app short, used for rg | `string` | n/a | yes | -| [consumption\_budget\_amount](#input\_consumption\_budget\_amount) | The amount of money to be consumed | `number` | n/a | yes | -| [consumption\_budget\_notification\_cfg](#input\_consumption\_budget\_notification\_cfg) | The notification blocks |
map(object({
enabled = optional(bool)
threshold = optional(number)
operator = optional(string)
contact_emails = optional(list(string))
}))
|
{
"notification1": {
"enabled": false
}
}
| no | -| [consumption\_budget\_time\_grain](#input\_consumption\_budget\_time\_grain) | The time grain for the consumption budget | `string` | `"Monthly"` | no | -| [cost\_anomaly\_alert\_email\_receivers](#input\_cost\_anomaly\_alert\_email\_receivers) | The email addresses to receive cost anomaly alerts | `list(string)` | `[]` | no | -| [environment](#input\_environment) | The runtime environment targeted. Development, test, qa, production etc | `string` | n/a | yes | -| [subscription](#input\_subscription) | The subscription | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [consumption\_budget\_id](#output\_consumption\_budget\_id) | value of the consumption budget id | -| [cost\_anomaly\_alert\_id](#output\_cost\_anomaly\_alert\_id) | value of the cost anomaly alert id | - +I've messed up the readme \ No newline at end of file From 1d98ce2f9fd144cd3e5ba654105b464cfc3ab9ff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 11:59:49 +0000 Subject: [PATCH 9/9] terraform-docs: automated action --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea3675c..8e17ca5 100644 --- a/README.md +++ b/README.md @@ -124,4 +124,45 @@ git push --tags # push the new tags Below is a placeholder for Terraform-docs generated documentation. Do not edit between the delimiters. ## Requirements -I've messed up the readme \ No newline at end of file +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.8.0, < 2.0.0 | +| [azurerm](#requirement\_azurerm) | >= 3.0.0, < 5.0.0 | + +## Providers + +| Name | Version | +|------|---------| +| [azurerm](#provider\_azurerm) | >= 3.0.0, < 5.0.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [azurerm_consumption_budget_subscription.sub_budget_consumption](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_subscription) | resource | +| [azurerm_cost_anomaly_alert.sub_cost_anomaly_alert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cost_anomaly_alert) | resource | +| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [app\_short\_name](#input\_app\_short\_name) | Name of app short, used for rg | `string` | n/a | yes | +| [consumption\_budget\_amount](#input\_consumption\_budget\_amount) | The amount of money to be consumed | `number` | n/a | yes | +| [consumption\_budget\_notification\_cfg](#input\_consumption\_budget\_notification\_cfg) | The notification blocks |
map(object({
enabled = optional(bool)
threshold = optional(number)
operator = optional(string)
contact_emails = optional(list(string))
}))
|
{
"notification1": {
"enabled": false
}
}
| no | +| [consumption\_budget\_time\_grain](#input\_consumption\_budget\_time\_grain) | The time grain for the consumption budget | `string` | `"Monthly"` | no | +| [cost\_anomaly\_alert\_email\_receivers](#input\_cost\_anomaly\_alert\_email\_receivers) | The email addresses to receive cost anomaly alerts | `list(string)` | `[]` | no | +| [environment](#input\_environment) | The runtime environment targeted. Development, test, qa, production etc | `string` | n/a | yes | +| [subscription](#input\_subscription) | The subscription | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [consumption\_budget\_id](#output\_consumption\_budget\_id) | value of the consumption budget id | +| [cost\_anomaly\_alert\_id](#output\_cost\_anomaly\_alert\_id) | value of the cost anomaly alert id | +