Error: Error launching source instance: Unsupported: The requested configuration is currently not supported

I’m learning Terraform course ‘Learn DevOps: Infrastructure Automation With Terraform’ from Udemy. As per the exercise 'First steps in terraform - Spinning up an instance’when i’m running ‘instance.tf’ i’m getting the below error.

Here is my instance.tf file.
Capture1

Please help.

Hi @SuryaDilip!

This is an AWS error rather than a Terraform error, so you might get a more specific answer if you ask in an AWS forum, but I’ll do my best to guess what might be going on here. I’m also not familiar with the Udemy course you are following, so I’m not sure if there’s any additional context in that guide about how this is set up.

One guess is that the AMI you’ve selected here is using one or more EC2 features that are not available on a t2.micro instance, in which case you’d need to select a more specialized instance type that has those features available.

Another guess is that t2.micro instances are currently not available in your target availability zone. That doesn’t seem very likely to me given how common the t2.micro instance type is, but I believe that is one reason why EC2 can return this error message.

Sadly it’s impossible to be sure what’s going on here because that error message is very generic and its details are part of the underlying AWS API implementation rather than something Terraform directly controls. I hope the above hints will help! If not, you might be able to get some AWS-specific help from the AWS developer forums or by contacting your course instructor to verify that this AMI ID is still valid.

Issue resolved. I changed the region to US West and changed the ami id accordingly. It worked. The problem was with the region and ami id. ThankU for taking time to read my post and reply.

1 Like

I am having exact problem as reported in this thread. I have tried to change the region but the error is persisting. On running ‘terraform apply’ in debug mode, I could see below error-

2019-11-29T06:46:30.437Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: -----------------------------------------------------
2019-11-29T06:46:30.696Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: 2019/11/29 06:46:30 [DEBUG] [aws-sdk-go] DEBUG: Response ec2/RunInstances Details:
2019-11-29T06:46:30.696Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: ---[ RESPONSE ]--------------------------------------
2019-11-29T06:46:30.696Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: HTTP/1.1 400 Bad Request
2019-11-29T06:46:30.697Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: Connection: close
2019-11-29T06:46:30.697Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: Transfer-Encoding: chunked
2019-11-29T06:46:30.697Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: Date: Fri, 29 Nov 2019 06:46:30 GMT
2019-11-29T06:46:30.697Z [DEBUG] plugin.terraform-provider-aws_v2.40.0_x4: Server: AmazonEC2

I have tried with the new AWS account, new user but no luck.
Any guesses?

For me it was happening because i was using obseleted instance type m3 family is discard and i was refering this into my template i changed it to m4 it starts working

So if you are using any resource that doesn’t exist on aws you will see the above error

Hi SuryaDilip,

I’m also facing same issue, I’ve changed the instance type from T2.micro to T3.micro and changed the AMI ID (In ami it comes with two architecture arm and X86). I hope by default it will create using arm . So I’ve selected ami only have x86 then instance will create successfully . try it.

Thanks

I also have the same issue and then i change the ami . The ami you provided must be single mean to say that the instance you want to launch have only one ami id then it will work fine.

I got this error from Packer … it seems that the c4 instance types are not available in Stockholm.

That’ll teach me to me more aggressive about using the latest and greatest instance types across the board :slight_smile:

I’m having the same issue. The funny thing is that if i run the ami and t2.micro manually, it works just fine. If i’m trying by terraform, it outputs that error. Now i’ll try to play with instance types and also change the region. I’ll post here how it works.
Thanks

Guys,

Initially I was working on Frankfurt region. (eu-central-1) and it didn’t work with t2.micro.
As soon as i switched to t3.micro it started working. Thanks for the hint.
I noticed that if i increase the number of instances and apply the changes it’s modifying very very slowly, like 7 mins for one or two instances. i destroyed all and apply terraform again already with t3.micro, the same, it modified everything but take about 7 mins and outputs also some error.

it doesn’t seem to be working with t2.micro also in us-east-1. So changing to t3.micro helped to solve this.

I am facing this same issue. Scenario:

  • Create EC2 instance with t2.micro instance type.
  • change the t2.micro to t2.medium in aws.
  • run terraform refresh, plan and apply

It change the instance type from t2.medium back to t2.micro but unable to start the instance.

Ideally terraform should not perform the update in-place action since t2.medium to t2.micro is ebs-optimized and terraform should destroy and recreate the instance. something missing at terraform side,

My issue was, the selected instance types did not match the EBS optimization.
This AWS provided error message is meaningless and unhelpful.
When you have many different parameters coming from many different remote states the only way to find out what went wrong if you extract the resource from the TF plan and read it in its own.

instance_type = “t2.micro”

change to

instance_type = “t3.micro”

is OK for me.

1 Like