如何使用Terraform将图库中的PowerShel模块安装到我的azure自动化帐户中?
我尝试使用powershellgallery API url:
resource "azurerm_automation_account" "aac" {
name = var.azure_automation_account_name
location = var.location
tags = var.tags
resource_group_name = var.resource_group
sku_name = "Basic"
}
resource "azurerm_automation_module" "az_accounts" {
name = "az_accounts"
resource_group_name = var.resource_group
automation_account_name = azurerm_automation_account.aac.name
module_link {
uri = "https://www.powershellgallery.com/api/v2/package/az.accounts/2.2.4"
}
}这总是会给我带来一个错误(我尝试了几个不同版本的模块,没有什么区别):
Error: Error waiting for Module "az_accounts" (Automation Account "XXX" / Resource Group "YYY") to finish provisioning: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: Cannot import the module of name az_accounts, as the module structure was invalid.我在这里做错了什么?
1月
发布于 2021-02-04 15:52:55
模块名称应为"Az.Accounts"。这对我很有效。
resource "azurerm_automation_module" "example" {
name = "Az.Accounts"
resource_group_name = azurerm_resource_group.example.name
automation_account_name = azurerm_automation_account.example.name
module_link {
uri = "https://www.powershellgallery.com/api/v2/package/az.accounts/2.2.4"
}
}

https://stackoverflow.com/questions/66041169
复制相似问题