【问题标题】:Error: Error launching source instance: Unsupported: The requested configuration is currently not supported错误:启动源实例时出错:不支持:当前不支持请求的配置
【发布时间】:2019-12-29 21:01:00
【问题描述】:

我正在学习 Udemy 的 Terraform 课程“Learn DevOps: Infrastructure Automation With Terraform”。根据练习“terraform 中的第一步 - 启动实例”,当我运行“instance.tf”时,我收到以下错误。

Error: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
    status code: 400, request id: cbfbb2e8-35bd-4527-8da3-b59506c55b81

  on instance.tf line 7, in resource "aws_instance" "example":
   7: resource "aws_instance" "example" {

这是我的 instance.tf 文件。

provider "aws" {
  access_key = "XXXXXXXXXXXXXXXXXX"
  secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXX"
  region     = "ap-south-1"
}

resource "aws_instance" "example" {
  ami           = "ami-0e175be6acf8b637d"
  instance_type = "t2.micro"
}

请帮忙。

【问题讨论】:

  • 对于那些从谷歌来到这里的人,这个错误通常意味着您选择的某些资源选项不可用。在我的情况下,所选区域没有“t2.micro”实例大小。

标签: terraform terraform-provider-aws


【解决方案1】:

代码看起来不错。

请检查此 AMI ami-0e175be6acf8b637d 是否存在于亚太地区(孟买)

如果没有,你会得到上述错误。

【讨论】:

  • 谢谢队友,辛苦了。我将地区更改为美国西部并使用新的 ami id 运行代码
【解决方案2】:

您可以在正确的 AMI 详细信息后解决此问题。

【讨论】:

    【解决方案3】:

    检查区域上的实例类型。就我而言,它确实首先失败了,但是当我检查我在脚本上选择的实例类型时,该实例类型在我指定的区域上不可用。 更改实例类型后,它确实起作用了。试试看

    instance_type = "t3.micro" }

    【讨论】:

      猜你喜欢
      • 2018-01-04
      • 1970-01-01
      • 2020-07-17
      • 2019-04-04
      • 2016-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多