英文:
Why mt terraform file provisioner need a connection configuration?
问题
我正在测试Terraform中的配置提供程序。这是我的示例:
resource "null_resource" "demo_provisioner" {
provisioner "file" {
source = "C:\\test\\example.txt"
destination = ".\\example.txt"
}
}
我只是将一个本地文件复制到另一个地方,但我收到了以下错误消息:
配置提供程序缺少连接配置。
我不明白为什么会发生这种情况。文档提供了一些相似的示例,但没有提到连接。我的代码有什么问题?
英文:
I am testing provisioner in Terraform.
This is my sample:
resource "null_resource" "demo_provisioner" {
provisioner "file" {
source = "C:\\test\\example.txt"
destination = ".\\example.txt"
}
}
I am just copying a local file to another one, but I get this erreor message:
> Missing connection configuration for provisioner.
I don't understand why this happen. The documentation gives some quite similar example without telling about connection.
What is wrong in my code?
答案1
得分: 1
如果您查看TF文档,它指出file provisioner 是关于将文件复制到远程机器,这需要连接到远程机器的 connection
信息。
要复制本地文件,您可以使用local_file。
英文:
If you check TF docs, it says that file provisioner is about copping files to remote machine, which requires a connection
information to the remote machine.
To copy local files, you can use local_file instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论