有谁能帮我的忙吗?我想用Terraform从runbook图库中导入一个在蔚蓝自动化帐户中的runbook。在下面的示例中,我引用了一个URI,但我想从runbook图库导入:
resource "azurerm_automation_runbook" "example" {
name = "Get-AzureVMTutorial"
location = "${azurerm_resource_group.example.location}"
resource_group_name = "${azurerm_resource_group.example.name}"
account_name = "${azurerm_automation_account.example.name}"
log_verbose = "true"
log_progress = "true"
description = "This is an example runbook"
runbook_type = "PowerShellWorkflow"
publish_content_link {
uri = "${var.runbooklink}"
}
}`
发布于 2018-08-09 11:19:49
在入口
自动化帐户->运行库->浏览库->选择要导入->查看源代码项目的运行库
复制url
View将重定向到特定运行簿的URI (gallery.technet.microsoft.com中的源代码)
对于上面的图像(例如,hello表示蔚蓝的runbook ),它将URI重定向给我,如
只需将其粘贴到您的代码(uri = "${var.runbooklink}"
)中即可。
resource "azurerm_automation_runbook" "demorunbook" {
name = "Write-HelloWorld"
location = "${azurerm_resource_group.development1.location}"
resource_group_name = "${azurerm_resource_group.development1.name}"
account_name = "automationAccount1"
log_verbose = "true"
log_progress = "true"
description = "This is an example runbook"
runbook_type = "PowerShellWorkflow"
publish_content_link {
uri = "https://gallery.technet.microsoft.com/scriptcenter/The-Hello-World-of-Windows-81b69574/file/111354/1/Write-HelloWorld.ps1"
}
}
注释源代码中运行簿的名称应该是运行簿名称的名称
https://stackoverflow.com/questions/51762668
复制相似问题