标签: hashicorp

GPG错误:https://apt.releases.hashicorp.com Bionic InRelease:由于公钥不可用,无法验证以下签名

我运行此命令来更新 ubuntu VM 中的软件包。

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

它最后给了我以下错误。

Err:5 https://apt.releases.hashicorp.com bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
Fetched 12.0 kB in 1s (10.4 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://apt.releases.hashicorp.com bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
W: …
Run Code Online (Sandbox Code Playgroud)

apt terraform hashicorp

26
推荐指数
1
解决办法
2万
查看次数

当我从 plan -out=file 执行 terraform apply 时,依赖性不一致

我正在尝试使用远程后端在 GCP 上创建新资源\n执行 terraform init plan -out=tfplan 然后 terraform apply tfplan 后,出现以下错误:

\n
Error: Inconsistent dependency lock file\n\xe2\x94\x82 \n\xe2\x94\x82 The following dependency selections recorded in the lock file are\n\xe2\x94\x82 inconsistent with the configuration in the saved plan:\n\xe2\x94\x82 Terraform 0.13 and earlier allowed provider version constraints inside the\n\xe2\x94\x82 provider configuration block, but that is now deprecated and will be\n\xe2\x94\x82 removed in a future version of Terraform. To silence this warning, move the\n\xe2\x94\x82 provider version constraint into the required_providers block.\n\xe2\x94\x82 \n\xe2\x94\x82 (and …
Run Code Online (Sandbox Code Playgroud)

lockfile terraform hashicorp

12
推荐指数
2
解决办法
5万
查看次数

Vagrant VMware 实用程序驱动程序

首先,如果有人已经提出了这个问题,我很抱歉,在这种情况下,请将链接粘贴到此处,因为我没有找到任何内容。我正在学习 vagrant,使用 virtualbox 我在运行虚拟机时没有问题,但如果我想使用 VMware 作为提供程序。我遇到此消息,但找不到摆脱此问题的方法。我认为一切都配置良好,但显然有些问题。

当我启动时vagrant up --provider=vmware_desktop,我收到以下错误消息:

Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver. Please try to run the command
again. If this error persists, please contact support@hashicorp.com
Run Code Online (Sandbox Code Playgroud)

我目前使用的是 Fedora 35

Operating System: Fedora Linux 35 (Workstation Edition)
          Kernel: Linux 5.17.5-200.fc35.x86_64
    Architecture: x86-64
Run Code Online (Sandbox Code Playgroud)

vmware vagrant hashicorp

8
推荐指数
1
解决办法
6160
查看次数

Terraform:错误:缺少提供者的资源架构。找不到 local_file 的资源架构

我正在使用 terraform 版本 0.13.2,提供商http://registry.terraform.io/hashicorp/local v2.1.0 并拥有以下资源:

\n
terraform {\n  required_providers {\n    local = {\n      source = "hashicorp/local"\n    }\n  }\n  required_version = ">= 0.13"\n}\n\nresource "local_file" "test_local_file" {\n  content = "This is a test file"\n  filename = "test.txt"\n}\n
Run Code Online (Sandbox Code Playgroud)\n

现在,当我仅获取另一个目录中的 terraform.tfstate 文件并尝试在新目录中使用 terraform 1.1.2 销毁此配置时,我在 terraform destroy 上收到以下错误:

\n
\xe2\x94\x82 Error: Missing resource schema from provider\n\xe2\x94\x82 \n\xe2\x94\x82 No resource schema found for local_file.\n
Run Code Online (Sandbox Code Playgroud)\n

解决办法是什么?

\n

terraform hashicorp

7
推荐指数
1
解决办法
2万
查看次数

Terraform云配置动态工作区名称

我正在使用 GitHub Actions 和 Terraform 构建 CI/CD 管道。我有一个如下所示的 main.tf 文件,我从多个环境的 GitHub 操作中调用该文件。我正在使用https://github.com/hashicorp/setup-terraform与 GitHub 操作中的 Terraform 进行交互。我有 MyService 组件,并且正在部署到 DEV、UAT 和 PROD 环境。我想在所有环境中重用 main.tf 并动态设置工作区名称,如下所示:MyService-DEV、MyService-UAT、MyService-PROD。terraform/cloud 块中不允许使用变量。我正在使用 HashiCorp 云来存储状态。

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~> 2.0"
    }
  }

  cloud {
    organization = "tf-organization"
    workspaces {
      name = "MyService-${env.envname}" #<==not allowed to use variables
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

更新

我终于成功地启动并运行了这个程序并提供了有用的评论。以下是我的发现:

  • TF_WORKSPACE 需要预先定义,例如:service-dev
  • 在自动化运行时,我没有让标签按照我想要的方式工作。如果我将 cloud.workspaces.tags 中的标签定义为“service”,则无法动态设置第二个标签(如“dev”)。在 init ['service', 'dev'] 期间需要这两个标签,以便 TF 自动选择工作区 service-dev。
  • 我最终使用 tfe 提供程序来自动设置工作区(带标签)。最后我还是需要设置 …

terraform devops hashicorp

6
推荐指数
1
解决办法
2107
查看次数

terraform 解决冲突的提供者约束:没有可用的版本与给定的约束匹配

您好,我正在尝试计划地形更新。我们正在使用一个由许多模块组成的复杂的 terraform 项目。

我添加了一个需要hashicorp/null版本 ~> 3.1.0 的 CloudSQL 数据库模块,但我项目中的另一个模块似乎对hashicorp/null版本 ~> 2.1 有依赖约束。

导致出现以下错误:

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider hashicorp/null:
no available releases match the given constraints ~> 2.1, ~> 3.1.0
Run Code Online (Sandbox Code Playgroud)

如何跟踪和更新此依赖性约束?我不知道我的项目的哪一部分正在执行它?

terraform terraform-provider-gcp hashicorp

5
推荐指数
1
解决办法
2654
查看次数

Terraform 初始化失败。错误:无法查询可用的提供程序包

安装的 terraform 和 init 失败。

\n
- Finding hashicorp/aws versions matching "~> 4.16"...\n\xe2\x95\xb7\n\xe2\x94\x82 Error: Failed to query available provider packages\n\xe2\x94\x82 \n\xe2\x94\x82 Could not retrieve the list of available versions for provider hashicorp/aws: could not connect to registry.terraform.io: Failed to request discovery document: Get\n\xe2\x94\x82 "https://registry.terraform.io/.well-known/terraform.json": x509: \xe2\x80\x9ccf-registry.tf-registry-prod-use1.terraform.io\xe2\x80\x9d certificate is not standards compliant\n
Run Code Online (Sandbox Code Playgroud)\n
terraform {\n  required_providers {\n    aws = {\n      source  = "hashicorp/aws"\n      version = "~> 4.16"\n    }\n  }\n\n  required_version = ">= 1.2.0"\n}\n\nprovider "aws" {\n  region  = "us-west-2"\n}\n\nresource "aws_instance" "app_server" {\n …
Run Code Online (Sandbox Code Playgroud)

infrastructure terraform terraform-provider-aws hashicorp

5
推荐指数
1
解决办法
2306
查看次数

Terraform aws_eip 资源获取不可配置属性的值“错误”

我是 Terraform 的新手,正在学习有关如何创建 aws_elasticip 模块的教程。当我执行“terraform plan”时,出现此问题,并且我无法继续创建 terraform 文件。

\n
 terraform {\n  required_providers {\n    aws = {\n      source  = "hashicorp/aws"\n      version = "~> 4.16"\n    }\n  }\n}\n\nprovider "aws" {\n  region = "eu-west-2"\n}\n\nresource "aws_eip" "lb" {\n  domain = "vpc"\n}\n
Run Code Online (Sandbox Code Playgroud)\n

我还尝试使用声明的实例变量来执行此操作,但错误仍然存​​在

\n
terraform {\n  required_providers {\n    aws = {\n      source  = "hashicorp/aws"\n      version = "~> 4.16"\n    }\n  }\n}\n\nprovider "aws" {\n  region = "eu-west-2"\n}\n\nresource "aws_vpc" "vpc_a" {\n  cidr_block = "10.0.0.0/16"\n}\n\nresource "aws_instance" "server_a" {\n    ami = "ami-06464c878dbe46da4"\n    instance_type = "t2.micro"\n}\n\nresource "aws_eip" "lb" {\n    instance = …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services terraform hashicorp

5
推荐指数
1
解决办法
1606
查看次数

无法更新 terraform 版本

我的provider.tf 文件中已经有最新版本:

  required_providers {
    archive = {
      source  = "hashicorp/archive"
      version = "2.2.0"
    }
    aws     = {
      source  = "hashicorp/aws"
      version = "3.72.0"
    }
  }
Run Code Online (Sandbox Code Playgroud)

然而,当我检查terraform version我的终端时,我得到了这个:

Terraform v1.0.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v3.72.0

Your version of Terraform is out of date! The latest version
is 1.1.4. You can update by downloading from https://www.terraform.io/downloads.html
Run Code Online (Sandbox Code Playgroud)

我已经尝试过terraform init -upgrade,但这也没有什么区别。我还从网站手动下载了 terraform 的新版本,但我的终端仍然显示 1.0.7。

由于旧的 Terraform 版本,我面临其他错误。如何使用终端更新到最新版本?

version terraform terraform-provider-aws hashicorp

2
推荐指数
1
解决办法
6179
查看次数