diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 78f56ca..91a19b8 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,7 @@ on: - master env: - TERRAFORM_DOCS_VERSION: v0.17.0 + TERRAFORM_DOCS_VERSION: v0.16.0 jobs: collectInputs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b38b8a..e210a5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.87.0 + rev: v1.75.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/README.md b/README.md deleted file mode 100644 index 3fe987e..0000000 --- a/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# Azure Automation Runbook Terraform module -Terraform module for creation Azure Automation Runbook - -## Usage - -```hcl -locals { - current_date_plus_one_day = substr(timeadd(timestamp(),"24h"),0,10) - - automation_runbook = { - - # Runbook Parameters - runbook : { - name = "VMStartStop" - description = "Example VM Start/Stop script" - content = templatefile("../scripts/vm_stop.tftpl", { - name = "VMStartStop" - vm_id = data.azurerm_virtual_machine.example.id - subscription_id = data.azurerm_client_config.current.subscription_id - }) - } - - # Parameters of Runbook's Schedules to create - schedules : [{ - name = "StartVM" - start_time = format("%sT09:00:00Z", local.current_date_plus_one_day) - parameters = { - action = "start" - } - }, { - name = "StopVM" - start_time = format("%sT09:00:00Z", local.current_date_plus_one_day) - parameters = { - action = "stop" - } - }] - } -} - -data "azurerm_virtual_machine" "example" { - name = "vm" - resource_group_name = "example" -} - -data "azurerm_automation_account" "example" { - name = "example" - resource_group_name = "example" -} - -module "automation-runbook" { - source = "data-platform-hq/automation-runbook/azurerm" - version = "~> 1.0" - - project = var.project - env = var.env - location = var.location - resource_group = data.azurerm_automation_account.example.resource_group_name - automation_account_name = data.azurerm_automation_account.example.name - - runbook = local.automation_runbook.runbook - schedule = local.automation_runbook.schedules -} -``` - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.0.0 | -| [azurerm](#requirement\_azurerm) | >= 3.40.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | >= 3.40.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_automation_job_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_job_schedule) | resource | -| [azurerm_automation_runbook.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_runbook) | resource | -| [azurerm_automation_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_schedule) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [automation\_account\_name](#input\_automation\_account\_name) | Automation Account name | `string` | n/a | yes | -| [location](#input\_location) | Azure location | `string` | n/a | yes | -| [resource\_group](#input\_resource\_group) | Resource group name where Automation Account is located | `string` | n/a | yes | -| [runbook](#input\_runbook) | Objects with parameters to configure Runbook |
object({
name = optional(string),
description = optional(string),
script_path = optional(string),
content = optional(string)
log_verbose = optional(bool, true),
log_progress = optional(bool, true),
runbook_type = optional(string, "PowerShellWorkflow")
})
| n/a | yes | -| [schedules](#input\_schedules) | Set of objects with parameters to configure Schedules for Runbook |
set(object({
name = optional(string),
description = optional(string),
frequency = optional(string, "Week"),
interval = optional(string, "1"),
start_time = optional(string, null),
week_days = optional(list(string), ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"])
parameters = optional(any, {})
}))
| `[]` | no | -| [tags](#input\_tags) | Resource tags | `map(any)` | `{}` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [runbook\_id](#output\_runbook\_id) | Automation Runbook Id | - - -## License - -Apache 2 Licensed. For more information please see [LICENSE](./LICENSE)