User Story 60501: batch-account-with-storage (#194)
* New sample (converted from Bicep via OpenAI) * Edit per Code Review * Changes per Code Review
This commit is contained in:
40
quickstart/101-batch-account-with-storage/main.tf
Normal file
40
quickstart/101-batch-account-with-storage/main.tf
Normal file
@ -0,0 +1,40 @@
|
||||
resource "random_pet" "rg_name" {
|
||||
prefix = var.resource_group_name_prefix
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "rg" {
|
||||
name = random_pet.rg_name.id
|
||||
location = var.resource_group_location
|
||||
}
|
||||
|
||||
resource "random_string" "azurerm_storage_account_name" {
|
||||
length = 13
|
||||
lower = true
|
||||
numeric = false
|
||||
special = false
|
||||
upper = false
|
||||
}
|
||||
|
||||
resource "random_string" "azurerm_batch_account_name" {
|
||||
length = 13
|
||||
lower = true
|
||||
numeric = false
|
||||
special = false
|
||||
upper = false
|
||||
}
|
||||
|
||||
resource "azurerm_storage_account" "storage" {
|
||||
name = "storage${random_string.azurerm_storage_account_name.result}"
|
||||
resource_group_name = azurerm_resource_group.rg.name
|
||||
location = azurerm_resource_group.rg.location
|
||||
account_tier = element(split("_", var.storage_account_type), 0)
|
||||
account_replication_type = element(split("_", var.storage_account_type), 1)
|
||||
}
|
||||
|
||||
resource "azurerm_batch_account" "batch" {
|
||||
name = "batch${random_string.azurerm_batch_account_name.result}"
|
||||
resource_group_name = azurerm_resource_group.rg.name
|
||||
location = azurerm_resource_group.rg.location
|
||||
storage_account_id = azurerm_storage_account.storage.id
|
||||
storage_account_authentication_mode = "StorageKeys"
|
||||
}
|
Reference in New Issue
Block a user