需要Terraform Opsgenie字符串值

需要Terraform Opsgenie字符串值,terraform,opsgenie,Terraform,Opsgenie,我正在简化尝试terrafomr initopsgenie的提供者 我的terraform版本是: Terraform v0.12.6 Your version of Terraform is out of date! The latest version is 0.14.10. You can update by downloading from www.terraform.io/downloads.html 我的提供者是: terraform { # https://www.terr

我正在简化尝试
terrafomr init
opsgenie的提供者

我的terraform版本是:

Terraform v0.12.6

Your version of Terraform is out of date! The latest version
is 0.14.10. You can update by downloading from www.terraform.io/downloads.html
我的提供者是:

terraform {
  # https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version
  required_version = "~> 0.12"

  # https://www.terraform.io/docs/configuration/provider-requirements.html
  required_providers {
    opsgenie = {
      source  = "opsgenie/opsgenie",
      version = "~> 0"
    }
  }
我得到的错误是:

There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.

Error: Invalid version constraint

  on provider.tf line 16, in terraform:
  16:     opsgenie = {
  17:       source = "opsgenie/opsgenie"
  18:       version = "0.6.3"
  19:     }

A string value is required for opsgenie.

您的TF太旧了,并且您的语法是新的。发件人:

Terraform v0.13中添加了所需的_提供程序的name={source,version}语法。Terraform的早期版本使用版本约束字符串而不是对象(如mycloud=“~>1.0”),并且无法指定提供程序源地址。如果您想编写一个同时适用于Terraform v0.12和v0.13的模块,请参阅下面的v0.12兼容提供程序要求

您可以尝试(或升级您的TF):

terraform {
  # https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version
  required_version = "~> 0.12"

  # https://www.terraform.io/docs/configuration/provider-requirements.html
  required_providers {
    opsgenie = "~> 0"
  }