我正在使用 Terraform 在 Azure 中设置虚拟网络。
我有几个 VNet,每个 VNet 都有自己的网络安全组 100% 在 Terraform 中管理,在运行 Terraform 之前不存在除资源组之外的资源。
当我Terraform apply第一次运行时,所有资源都被正确创建。但是,如果我再次尝试运行 apply 以更新其他资源,则会收到错误消息,指出 NSG 资源已存在。
Error: A resource with the ID
"/subscriptions/0000000000000000/resourceGroups/SynthArtInfra/providers/Microsoft.Network/networkSecurityGroups/SynthArtInfra_ServerPoolNSG"
already exists - to be managed via Terraform this resource needs to be
imported into the State. Please see the resource documentation for
"azurerm_network_security_group" for more information.
Run Code Online (Sandbox Code Playgroud)
为什么 Terraform 抱怨现有资源,而它应该已经在它的控制之下?
编辑:这是与 NSG 相关的代码,其他一切都与 VPN 网关有关:
# Configure the Azure provider
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm" …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Win 10 上使用“hg add”向 Mercurial 添加大约 40k 个文件。由于下游限制,我需要将其分成每个添加/提交的 10k 个文件块,因此我需要传递大量文件列表添加到汞。但是我遇到了Window 的命令行参数字符限制。
有没有办法将文件中存储的文件列表传递给 hg add?AFAIK 不能只使用管道,因为这只是读取文件并将其作为参数传递。我认为 hg 需要直接读取文本文件。