Terraform: aws_opsworks_instance: cannot create instance, "is not a valid EC2 instance type in this region"

Created on 16 Apr 2017  ยท  7Comments  ยท  Source: hashicorp/terraform

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.9.3

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_opsworks_instance

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

The instance should have been created when running terraform apply

Actual Behavior

When I ran terraform apply, I received this error: https://gist.github.com/rsutton1/9f7e7afbf24b2f09caf8ee90630015f5

However, if I create an instance through the AWS Opsworks UI with the same instance type, it works. I even tried to set the availability_zone to us-east-1a in the aws_opsworks_instance resource, but it didn't help.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. I tried to create an instance using the sample code here: https://www.terraform.io/docs/providers/aws/r/opsworks_instance.html
  2. terraform apply
  3. This error appears https://gist.github.com/rsutton1/9f7e7afbf24b2f09caf8ee90630015f5

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
bug provideaws upstream

Most helpful comment

For instance types that only support EBS we would need to mention the root_device_type explicitly as ebs. This would solve the issue.

NOTE: It would be better to update the terraform docs appropriately.

All 7 comments

Actually, this is a problem with aws cli, not Terraform. When I try to create an instance directly with aws cli, I get the same error:

$ aws opsworks --region us-east-1 create-instance --stack-id fead6596-6616-447d-8f13-0c165eb3dd59 --layer-ids 9a2c5492-aa9c-4a8b-8714-edb7697d3640 --hostname aftp-cli --instance-type t2.micro
A client error (ValidationException) occurred when calling the CreateInstance operation: Instance Type: is not a valid EC2 instance type in this region

Regardless, this still prevents aws_opsworks_instance from working. How do we handle these issues? Should this issue be closed, or should it stay open until AWS fixes the issue on their end?

Hi @rsutton1

thanks for opening the issue - sorry this is causing some problems for you. Unfortunately, as you pointed out, this is an upstream issue. Therefore, it should be reported to AWS themselves

I am going to close this out as any changes to the API will be picked up by us when AWS fixes things on this side

Thanks

Paul

I still face this issue with v0.9.8.

* aws_opsworks_instance.api-n: ValidationException: Instance Type: is not a valid EC2 instance type in this region
    status code: 400, request id: ad0c8588-50de-11e7-9ff6-6b99574dd5ac

also note the aws-cli seems to be working

[x]$ aws opsworks create-instance --stack-id sssssssss --layer-ids sssssss --instance-type m3.xlarge --hostname api-n
{
    "InstanceId": "xxxxx"
}
[x]$ aws opsworks create-instance --stack-id sssss --layer-ids ssssssss --instance-type m3.xlarge
{
    "InstanceId": "xxxxx"
}

@rsutton1 did you have any luck with newer versions of Terraform?

@samof76 I only tried it with 0.9.3. I was writing this code for a job interview project, but because of this bug they rejected me.

For instance types that only support EBS we would need to mention the root_device_type explicitly as ebs. This would solve the issue.

NOTE: It would be better to update the terraform docs appropriately.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings