Azure Automation Runbook
This page shows how to write Terraform and Azure Resource Manager for Automation Runbook and write them securely.
azurerm_automation_runbook (Terraform)
The Runbook in Automation can be configured in Terraform with the resource name azurerm_automation_runbook
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_automation_runbook" "module_update" {
name = "rb-update-modules"
location = local.REGION
resource_group_name = "rg-automation"
automation_account_name = azurerm_automation_account.automation.name
log_verbose = "true"
resource "azurerm_automation_runbook" "StartVM" {
name = "StartVM1"
location = azurerm_resource_group.RG.location
resource_group_name = azurerm_resource_group.RG.name
automation_account_name = azurerm_automation_account.AR_Auto.name
log_verbose = "true"
resource "azurerm_automation_runbook" "tmp_rg_cleanup" {
name = "tmp_rg_cleanup"
location = azurerm_automation_account.resource-monitor.location
resource_group_name = azurerm_automation_account.resource-monitor.resource_group_name
automation_account_name = azurerm_automation_account.resource-monitor.name
log_verbose = "false"
resource "azurerm_automation_runbook" "scaleout" {
depends_on = [azurerm_template_deployment.logicapp-sapregister]
name = "SAPScaleOut"
location = var.location
resource_group_name = data.azurerm_resource_group.scaling-rg.name
automation_account_name = azurerm_automation_account.scalingaccount.name
resource "azurerm_automation_runbook" "scaleout" {
depends_on = [azurerm_template_deployment.logicapp-sapregister]
name = "SAPScaleOut"
location = var.location
resource_group_name = data.azurerm_resource_group.scaling-rg.name
automation_account_name = azurerm_automation_account.scalingaccount.name
resource "azurerm_automation_runbook" "aar" {
name = var.res_aar_name
location = var.res_location
resource_group_name = var.res_aar_rg_name
account_name = var.res_aa_name
log_verbose = var.res_aar_log_verbose
resource "azurerm_automation_runbook" "togglevmpower" {
name = "Toggle_VM_Power_State"
location = data.azurerm_resource_group.autorg.location
resource_group_name = data.azurerm_resource_group.autorg.name
automation_account_name = data.azurerm_automation_account.autoacct.name
log_verbose = "true"
resource "azurerm_automation_runbook" "tagging_remediation" {
name = "TaggingRemediation"
location = data.azurerm_resource_group.main.location
resource_group_name = data.azurerm_resource_group.main.name
automation_account_name = data.azurerm_automation_account.main.name
log_verbose = "true"
resource "azurerm_automation_runbook" "this" {
automation_account_name = var.automation_account_name
content = var.content
description = var.description
location = var.location
log_progress = var.log_progress
resource "azurerm_automation_runbook" "this" {
automation_account_name = var.automation_account_name
content = var.content
description = var.description
location = var.location
log_progress = var.log_progress
Parameters
-
automation_account_name
required - string -
content
optional computed - string -
description
optional - string -
id
optional computed - string -
job_schedule
optional computed - set of object-
job_schedule_id
- string -
parameters
- map from string to string -
run_on
- string -
schedule_name
- string
-
-
location
required - string -
log_progress
required - bool -
log_verbose
required - bool -
name
required - string -
resource_group_name
required - string -
runbook_type
required - string -
tags
optional - map from string to string -
publish_content_link
list block -
timeouts
single block
Explanation in Terraform Registry
Manages a Automation Runbook.
Microsoft.Automation/automationAccounts/runbooks (Azure Resource Manager)
The automationAccounts/runbooks in Microsoft.Automation can be configured in Azure Resource Manager with the resource name Microsoft.Automation/automationAccounts/runbooks
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Frequently asked questions
What is Azure Automation Runbook?
Azure Automation Runbook is a resource for Automation of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Automation Runbook?
For Terraform, the nocticdr/azure-terraform-modules, ashutosh-rathore/AR_LAB1 and mozilla-platform-ops/relops_infra_as_code source code examples are useful. See the Terraform Example section for further details.