_This issue was originally opened by @anoopsrawat as hashicorp/terraform#18215. It was migrated here as a result of the provider split. The original body of the issue is below._
Hi There
i have facing some error in run terraform script ec2 inctance. below the error.
aws_instance.server2: 1 error(s) occurred:
aws_instance.server2: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: d9d20b5a-baa8-4b56-b692-aad3ab8747b6
aws_instance.server1: 1 error(s) occurred:
aws_instance.server1: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: 5ad96e16-6a29-413f-98f0-77487203817e
Hi @anoopsrawat,
to better understand the issue & make it possible to reproduce for anyone else would you mind sharing more details? e.g.
Thanks.
hi,
i share with you my script. instance not created in security group.
provider "aws" {
access_key = ""
secret_key = ""
region = "us-west-2"
}
resource "aws_vpc" "stg_demo" {
cidr_block = "172.16.0.0/16"
instance_tenancy = "dedicated"
tags {
Name = "stg_demo"
}
}
resource "aws_internet_gateway" "gw" {
vpc_id = "${aws_vpc.stg_demo.id}"
tags {
Name = "main"
}
}
resource "aws_subnet" "web1" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.10.0/24"
availability_zone = "us-west-2a"
tags {
Name = "web1"
}
}
resource "aws_subnet" "web2" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.11.0/24"
availability_zone = "us-west-2b"
tags {
Name = "web2"
}
}
resource "aws_subnet" "db1" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.20.0/24"
availability_zone = "us-west-2a"
tags {
Name = "db1"
}
}
resource "aws_subnet" "db2" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.21.0/24"
availability_zone = "us-west-2b"
tags {
Name = "db2"
}
}
resource "aws_subnet" "app1" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.30.0/24"
availability_zone = "us-west-2a"
tags {
Name = "app1"
}
}
resource "aws_subnet" "APP2" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.31.0/24"
availability_zone = "us-west-2b"
tags {
Name = "app2"
}
}
resource "aws_subnet" "edge1" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.40.0/24"
availability_zone = "us-west-2a"
tags {
Name = "edge1"
}
}
resource "aws_subnet" "edge2" {
vpc_id = "${aws_vpc.stg_demo.id}"
cidr_block = "172.16.41.0/24"
availability_zone = "us-west-2b"
tags {
Name = "edge2"
}
}
resource "aws_route_table" "edge" {
vpc_id = "${aws_vpc.stg_demo.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
tags {
Name = "edge"
}
}
resource "aws_route_table" "web" {
vpc_id = "${aws_vpc.stg_demo.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
tags {
Name = "web"
}
}
resource "aws_route_table" "db" {
vpc_id = "${aws_vpc.stg_demo.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
tags {
Name = "db"
}
}
resource "aws_route_table" "app" {
vpc_id = "${aws_vpc.stg_demo.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
tags {
Name = "app"
}
}
resource "aws_security_group" "edge" {
name = "edge_sg"
description = "Allow all inbound traffic"
vpc_id = "${aws_vpc.stg_demo.id}"
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "edge_sg"
}
}
resource "aws_security_group" "web" {
name = "web_sg"
description = "Allow all inbound traffic"
vpc_id = "${aws_vpc.stg_demo.id}"
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "web_sg"
}
}
resource "aws_security_group" "app" {
name = "app_sg"
description = "Allow all inbound traffic"
vpc_id = "${aws_vpc.stg_demo.id}"
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "app_sg"
}
}
resource "aws_security_group" "db" {
name = "db_sg"
description = "Allow all inbound traffic"
vpc_id = "${aws_vpc.stg_demo.id}"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "db_sg"
}
}
resource "aws_instance" "web" {
instance_type = "t2.medium"
ami = "ami-25225e5d"
key_name = "org-pfin-stg"
security_groups = ["${aws_security_group.web.id}"]
subnet_id = "${aws_subnet.web1.id}"
associate_public_ip_address = "true"
tags {
Name = "webserver"
}
}
resource "aws_instance" "web1" {
instance_type = "t2.medium"
ami = "ami-f3c78b8b"
key_name = "org-pfin-stg"
security_groups = ["${aws_security_group.web.id}"]
subnet_id = "${aws_subnet.web2.id}"
associate_public_ip_address = "true"
tags {
Name = "webserver2"
}
}
resource "aws_instance" "app" {
instance_type = "t2.medium"
ami = "ami-5c450224"
key_name = "org-pfin-stg"
security_groups = ["${aws_security_group.app.id}"]
subnet_id = "${aws_subnet.app1.id}"
associate_public_ip_address = "true"
tags {
Name = "app1"
}
}
any update ?
Is this issue resolved? What is the solution? I am also facing same issue. I am just launching basic EC2 in non default VPC with most of the parameters as default ones.
Same here, facing very similar issue with basic configuration. I have it working with all regions except newly added eu-north-1. Using plugin v1.53.0
I'm also facing this issue launching Ubuntu 18.04 with no parameters in us-west-2
Update : I was able to fix this issue by checking what AWS AMI I was using. Changing from arm to amd solved it.
Hi All,
I am new to Terraform . But facing the issue today, which was not coming yesterday.
My default region is : e-west2 and the instances were coming up yesterday, but getting the issue today.
Any solution for the same, will be quite helpful.
Thanks
Milind
I have just run into the same thing, using an ubuntu AMI.
I switched to an Amazon Linux AMI, and it worked. Then I checked for the latest ubuntu 18.04 (the one that failed was of Feb-2019), and again this latest ubuntu image also worked.
So, this is likely to be AMI specific.
Thanks a lot @laymonk ... I faced the same issue ... when I changed the AMI as you suggested, it worked perfectly
Hi folks! 馃憢 Thanks for discussing this confusing error message here! That error message is certainly vague.
This particular error messaging is coming from the EC2 API itself:
Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
And unfortunately, the Terraform AWS Provider aws_instance resource does not get any additional insight into _why_ this particular error message occurred as we are just passing it through. In this situation, the best we might be able to do within our code is catch and wrap this particular error message with some additional messaging, e.g.
aws_instance.server1: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: 5ad96e16-6a29-413f-98f0-77487203817e
Some common items to check include:
* Instance Type is supported in the AWS Region
* Incorrect AMI architecture for Instance Type
* ... additional items here ...
As you can imagine though, even this might not be particularly helpful for operators since it cannot provide too much insight either. We will not know whether it was an instance type to region mismatch or some other condition that the EC2 API decided to trigger this message. I am not sure that we would want to accept the maintenance burden of implementing this additional messaging should it potentially be incorrect (e.g. leading operators down the wrong troubleshooting paths), missing troubleshooting paths, or if future updates to the EC2 API error break our handling for catching this scenario.
Your best bet to getting this error messaging within the EC2 API improved is to reach out with a feature request in an AWS Support Case or your AWS account managers if you have any. 馃憤
Since this likely falls under a case where we will not want to do anything to increase the code complexity here, I'm going to close this issue. I'm also going to lock this issue to encourage any additional bug reports or feature requests (unrelated to _this specific error_) be filed as new GitHub issues so we can appropriately triage. For further discussions on this message in your environment, we would recommend reaching out on the discussion forums available at https://discuss.hashicorp.com/c/terraform-providers where many more people are likely able to answer questions rather than this repository with its limited number of code maintainers.
Most helpful comment
I have just run into the same thing, using an ubuntu AMI.
I switched to an Amazon Linux AMI, and it worked. Then I checked for the latest ubuntu 18.04 (the one that failed was of Feb-2019), and again this latest ubuntu image also worked.
So, this is likely to be AMI specific.