4

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.
  • 1
    Show your plan, but I suspect the way you define the list of AZ is wrong – Tensibai Oct 27 '17 at 5:35
  • 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) – PrestonM Oct 27 '17 at 14:34
  • This is how I am declaring the AZ's in my code variable "azs" { default = "us-east-1b, us-east-1c, us-east-1d"} – SuperSaiyan123 Oct 27 '17 at 17:19
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.