一千萬個為什麽

搜索

無法使用地形在不同的可用區域中啟動多個EC2實例



每當我嘗試啟動實例時,我都會收到以下錯誤消息。請幫助。

錯誤:應用計劃時出錯:

3 error(s) occurred:

* aws_instance.example[0]: 1 error(s) occurred:

* aws_instance.example.0: Error launching source instance: InvalidParameterValue: Invalid availability zone: [{us-east-1b]
        status code: 400, request id: 2637e297-236d-4e3b-b5a4-b5afe3df5e67
* aws_instance.example[2]: 1 error(s) occurred:

* aws_instance.example.2: Error launching source instance: InvalidParameterValue: Invalid availability zone: [ us-east-1d}]
        status code: 400, request id: 59244720-ab1c-48c7-a9b8-3eb6a23bd5ae
* aws_instance.example[1]: 1 error(s) occurred:

* aws_instance.example.1: Error launching source instance: InvalidParameterValue: Invalid availability zone: [ us-east-1c]
        status code: 400, request id: 1e335e56-f129-4ea0-a5c6-09b0501b6e18

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

轉載註明原文: 無法使用地形在不同的可用區域中啟動多個EC2實例

一共有 1 個回答:

它看起來像你使用了錯誤的括號?我認為你需要使用一個列表:

variable "azs" {
  description = "Run the EC2 Instances in these Availability Zones"
  type = "list"
  default = ["us-east-1a", "us-east-1b", "us-east-1c"]
}