2 Answers
- Newest
- Most votes
- Most comments
2
I see you've already accepted A_J's answer, and if that works for you then that's great. But there appears to be a mismatch between the error message and the Terraform code.
The error message InvalidParameterValue: Invalid availability zone: [us-east-2]
is correct, because us-east-2 is a region, not an AZ.
The Terraform code clearly shows the AZ is us-east-2a (note the 'a' on the end):
availability_zone = "us-east-2a"
I'm confused at how that error message is generated by the given Terraform code.
1
Here is a corrected version of your Terraform file without specifying the availability_zone:
provider "aws" {
region = "us-east-2"
}
resource "aws_instance" "web" {
ami = "ami-0b0a32ffc011bf8c2"
instance_type = "t2.micro"
key_name = "love-sg"
vpc_security_group_ids = ["sg-067a6076c9de32a39"]
tags = {
Name = "love-Instance"
}
}
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 10 months ago