我正在将Jenkins管道与私有TFE作为后端集成,并使用保管库进行身份验证。
但是terraform计划给了我以下错误
Terraform v0.11.11
Configuring remote state backend...
Initializing Terraform configuration...
2019/05/14 00:11:01 [DEBUG] Using modified User-Agent: Terraform/0.11.11 PTFE/46ef48a
[31m
[1m[31mError: [0m[0m[1mprovider.vault: "address": required field is not set[0m
main.tf >>>>
provider "aws" { region = "us-east-1" }
resource "aws_instance" "my-test-instance" {
ami = "ami-0080e4c5bc078760e"
instance_type = "t2.micro"
tags { Name = "test-instance" }
}
詹金斯>>>
stage('terraform plan') {
steps {
script {
wrap([$class: 'VaultBuildWrapper', configuration:conf, vaultSecrets: secretz]) {
withCredentials([string(credentialsId: 'VAULTAWSTOKEN', variable: 'VAULT_TOKEN')]) {
sh "~/bin/aws sts get-caller-identity"
sh "${env.TERRAFORM_HOME} plan "
}
}
}
input (message: 'Ready to apply?', ok: 'Yes')
}
}
答案 0 :(得分:0)
您需要在代码中找到文件库提供者,并填写address
字段[1]
[1] https://www.terraform.io/docs/providers/vault/index.html#address