» azurerm_batch_account

Manages an Azure Batch account.

» Example Usage

resource "azurerm_resource_group" "example" {
  name     = "testbatch"
  location = "westeurope"
}

resource "azurerm_storage_account" "example" {
  name                     = "teststorage"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_batch_account" "example" {
  name                 = "testbatchaccount"
  resource_group_name  = azurerm_resource_group.example.name
  location             = azurerm_resource_group.example.location
  pool_allocation_mode = "BatchService"
  storage_account_id   = azurerm_storage_account.example.id

  tags = {
    env = "test"
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Batch account. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The name of the resource group in which to create the Batch account. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • pool_allocation_mode - (Optional) Specifies the mode to use for pool allocation. Possible values are BatchService or UserSubscription. Defaults to BatchService.

  • key_vault_reference - (Optional) A key_vault_reference block that describes the Azure KeyVault reference to use when deploying the Azure Batch account using the UserSubscription pool allocation mode.

  • storage_account_id - (Optional) Specifies the storage account to use for the Batch account. If not specified, Azure Batch will manage the storage.

  • tags - (Optional) A mapping of tags to assign to the resource.


A key_vault_reference block supports the following:

  • id - (Required) The Azure identifier of the Azure KeyVault to use.

  • url - (Required) The HTTPS URL of the Azure KeyVault to use.

» Attributes Reference

The following attributes are exported:

» Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Batch Account.
  • update - (Defaults to 30 minutes) Used when updating the Batch Account.
  • read - (Defaults to 5 minutes) Used when retrieving the Batch Account.
  • delete - (Defaults to 30 minutes) Used when deleting the Batch Account.

» Import

Batch Account can be imported using the resource id, e.g.

terraform import azurerm_batch_account.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Batch/batchAccounts/account1