如何在本地引用 Terraform 设置块中的.zip文件,而不是使用 URL



我在terraform中有一个设置块,现在它引用了一个.zip文件并使用url字段来引用它。如何在本地引用.zip文件?

PS 该模块在 GitHub 中,也可以在本地使用

谢谢

代码示例:(设置块来自 Terraform Azure VM 扩展(

settings = <<SETTINGS
{
"Wmfversion": "latest",
"Configuration":
{
"url": "https://....github/CreateADRootDC1.ps1.zip"
"script": "CreateADRootDC1.ps1",
"function": "CreateADRootDC1"   
},
}
can I refer to the file with this syntax "source:" = "./modules/addsvms/DSC/CreateADRootDC1.ps1.zip",

我使用 blob 存储来实现这一点:

"url" = "https://foo.blob.core.windows.net/dsc.zip" <<< get zip from this url and unzip it to a special folder on the vm
"script" = "configure.ps1" <<< load this file into memory
"function" = "AzureDscDemo" <<< call this function from inside the file

最新更新