Answers: <p>It looks like you're using the wrong brackets? I think you need to use a list:</p>
  
  <pre><code>variable "azs" {
    description = "Run the EC2 Instances in these Availability Zones"
    type = "list"
    default = ["us-east-1a", "us-east-1b", "us-east-1c"]
  }
  </code></pre>
  
  <p><a href="https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and-gotchas-f739bbae55f9" rel="nofollow noreferrer">Source</a></p>
  
Answers: CC BY-SA 3.0
Answers: 2017-11-03T16:09:30.933Z
Answers: 2017-11-03T16:09:30.933Z
Answers: alitheg
Body: <p>Whenever I try to launch the instances, I am getting the following error message. Please help with this.   </p>
  
  <p>Error: Error applying plan:</p>
  
  <pre><code>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.
  </code></pre>
  
Comments: CC BY-SA 3.0
Comments: 2017-10-27T05:35:15.533Z
Comments: Show your plan, but I suspect the way you define the list of AZ is wrong
Comments: Tensibai
Comments: CC BY-SA 3.0
Comments: 2017-10-27T14:34:22.440Z
Comments: Yes, show your plan in particular where you declare your availability zones (based on the { } in your error log, it looks like you might have a typo)
Comments: Preston Martin
Comments: CC BY-SA 3.0
Comments: 2017-10-27T17:19:40.960Z
Comments: This is how I am declaring the AZ's in my code variable "azs" {
         default = "us-east-1b, us-east-1c, us-east-1d"}
Comments: SuperSaiyan123
Tags: <amazon-ec2><terraform>
Title: Unable to launch multiple EC2 instances in different availability zones using terraform
UserDisplayName: SuperSaiyan123
ThreadText: # Unable to launch multiple EC2 instances in different availability zones using terraform
  
  (Asked by: username_0 on 2017-10-26)
  
  Whenever I try to launch the instances, I am getting the following error message. Please help with this.
  
  Error: Error applying plan:
  
  ```
  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.
  
  ```
  
  **Tags:** amazon-ec2, terraform
  
  > **Comments:**
  > **username_1**: Show your plan, but I suspect the way you define the list of AZ is wrong  
  > **username_2**: Yes, show your plan in particular where you declare your availability zones (based on the { } in your error log, it looks like you might have a typo)  
  > **username_0**: This is how I am declaring the AZ's in my code variable "azs" {        default = "us-east-1b, us-east-1c, us-east-1d"}  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2017-11-03. Score: 1
  
  It looks like you're using the wrong brackets? I think you need to use a list:
  
  ```
  variable "azs" {
    description = "Run the EC2 Instances in these Availability Zones"
    type = "list"
    default = ["us-east-1a", "us-east-1b", "us-east-1c"]
  }
  
  ```
  
  [Source](https://blog.gruntwork.io/terraform-tips-tricks-loops-if-statements-and-gotchas-f739bbae55f9)
  
  
  ---
  
  