using terraform import in your code

This feature has been around since version 1.5x and we can import cloud resources into terraform code block and the best part of it, we can update/modify the resource. In this example, I am going to import an Azure storage account and we change it to standard and sku to GRS. 

You will need to provide the key/critical fields that azurerm_storage_account requires tho. 



import {
  to = azurerm_storage_account.example
  id = "/subscriptions/our-subscription/resourceGroups/your-rg/providers
/Microsoft.Storage/storageAccounts/your-storage-account"
}

# you need to provide the core key mandatory fields tho.
resource "azurerm_storage_account" "example" {
  name                     = "your-storage-account"
  resource_group_name      = "your-rg"
  location                 = "your-location"
  account_tier             = "Standard" # changing this
  account_replication_type = "GRS"  # changing this
}






Comments

Popular posts from this blog

vllm : Failed to infer device type

android studio kotlin source is null error

gemini cli getting file not defined error