Terraform:如何将PS模块从Gallery安装到Azure Automation?
如何使用Terraform将PowerShel模块从Gallery安装到我的azure Automation帐户 我尝试使用powershellgallery API url:Terraform:如何将PS模块从Gallery安装到Azure Automation?,azure,terraform,terraform-provider-azure,azure-automation,Azure,Terraform,Terraform Provider Azure,Azure Automation,如何使用Terraform将PowerShel模块从Gallery安装到我的azure Automation帐户 我尝试使用powershellgallery API url: resource "azurerm_automation_account" "aac" { name = var.azure_automation_account_name location = var.location
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"
}
}
这总是让我出错(我尝试了几个不同版本的模块,没有任何区别):
我做错了什么
Jan模块名称应为
“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"
}
}
谢谢!对我也有用。。。我的错,我不知道名字真的很重要。。。
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"
}
}