Terraform 如何在配置中指定hashicorp/random版本?

Terraform 如何在配置中指定hashicorp/random版本?,terraform,Terraform,当我运行terraform plan或terraform apply时,输出包括: Initializing the backend... Initializing provider plugins... - Using previously-installed hashicorp/azurerm v2.36.0 - Using previously-installed hashicorp/random v3.0.0 The following providers do not have a

当我运行
terraform plan
terraform apply
时,输出包括:

Initializing the backend...

Initializing provider plugins...
- Using previously-installed hashicorp/azurerm v2.36.0
- Using previously-installed hashicorp/random v3.0.0

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* hashicorp/random: version = "~> 3.0.0"

如何在配置中指定hashicorp/random的版本?

只需在提供程序块中指定它:

provider "hashicorp/random" {
  version = "~> 3.0.0"
}