Terraform AWS 提供程序 : 启动源实例时出错: 不支持:当前不支持请求的配置



我正在尝试使用terraform作为自动化基础设施配置的开始。我已经定义了 VPC、子网。 我无法解决这个问题,我遇到了类似的问题,这些问题发布在堆栈溢出上,以检查AMI在区域中是否可用或检查VPC租赁。不幸的是,这些解决方案对我不起作用。 这是我的简单配置 main.tf

provider "aws" {
region = "eu-west-2"
}
resource "aws_instance" "test-instance1" {
ami               = "ami-07dc734dc14746eab"
ebs_optimized     = true
instance_type     = "t2.micro"
root_block_device {
volume_type           = "gp2"
volume_size           = 260
delete_on_termination = true
}
ebs_block_device {
device_name           = "/dev/sda1"
delete_on_termination = true
volume_size           = 260
volume_type           = "gp2"
}
}

这是地形应用的完整输出。

Master $ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_instance.test-instance1 will be created
+ resource "aws_instance" "test-instance1" {
+ ami                          = "ami-07dc734dc14746eab"
+ arn                          = (known after apply)
+ associate_public_ip_address  = (known after apply)
+ availability_zone            = (known after apply)
+ cpu_core_count               = (known after apply)
+ cpu_threads_per_core         = (known after apply)
+ ebs_optimized                = true
+ get_password_data            = false
+ host_id                      = (known after apply)
+ id                           = (known after apply)
+ instance_state               = (known after apply)
+ instance_type                = "t2.micro"
+ ipv6_address_count           = (known after apply)
+ ipv6_addresses               = (known after apply)
+ key_name                     = (known after apply)
+ network_interface_id         = (known after apply)
+ outpost_arn                  = (known after apply)
+ password_data                = (known after apply)
+ placement_group              = (known after apply)
+ primary_network_interface_id = (known after apply)
+ private_dns                  = (known after apply)
+ private_ip                   = (known after apply)
+ public_dns                   = (known after apply)
+ public_ip                    = (known after apply)
+ security_groups              = (known after apply)
+ source_dest_check            = true
+ subnet_id                    = (known after apply)
+ tenancy                      = (known after apply)
+ volume_tags                  = (known after apply)
+ vpc_security_group_ids       = (known after apply)
+ ebs_block_device {
+ delete_on_termination = true
+ device_name           = "/dev/sda1"
+ encrypted             = (known after apply)
+ iops                  = (known after apply)
+ kms_key_id            = (known after apply)
+ snapshot_id           = (known after apply)
+ volume_id             = (known after apply)
+ volume_size           = 260
+ volume_type           = "gp2"
}
+ ephemeral_block_device {
+ device_name  = (known after apply)
+ no_device    = (known after apply)
+ virtual_name = (known after apply)
}
+ metadata_options {
+ http_endpoint               = (known after apply)
+ http_put_response_hop_limit = (known after apply)
+ http_tokens                 = (known after apply)
}
+ network_interface {
+ delete_on_termination = (known after apply)
+ device_index          = (known after apply)
+ network_interface_id  = (known after apply)
}
+ root_block_device {
+ delete_on_termination = true
+ device_name           = (known after apply)
+ encrypted             = (known after apply)
+ iops                  = (known after apply)
+ kms_key_id            = (known after apply)
+ volume_id             = (known after apply)
+ volume_size           = 260
+ volume_type           = "gp2"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_instance.test-instance1: Creating...
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: 1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5
on main.tf line 5, in resource "aws_instance" "test-instance1":
5: resource "aws_instance" "test-instance1" {

Master $ 

我还启用了日志并将其设置为 TRACE。 这是完整的调试。

2020/05/11 22:48:38 [DEBUG] aws_instance.test-instance1: applying the planned Create change
2020/05/11 22:48:38 [TRACE] GRPCProvider: ApplyResourceChange
2020-05-11T22:48:38.524+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "ephemeral_block_device" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "metadata_options" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "security_groups" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "network_interface" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "network_interface" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "vpc_security_group_ids" from ComputedKeys
2020-05-11T22:48:38.525+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "volume_tags" from ComputedKeys
2020-05-11T22:48:38.540+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] setting computed for "ipv6_addresses" from ComputedKeys
2020-05-11T22:48:38.547+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] Describing AMI "ami-07dc734dc14746eab" to get root block device name
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:38 [DEBUG] [aws-sdk-go] DEBUG: Request ec2/DescribeImages Details:
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: ---[ REQUEST POST-SIGN ]-----------------------------
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: POST / HTTP/1.1
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Host: ec2.eu-west-2.amazonaws.com
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: User-Agent: aws-sdk-go/1.30.21 (go1.13.7; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.12.24 (+https://www.terraform.io)
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Content-Length: 72
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Content-Type: application/x-www-form-urlencoded; charset=utf-8
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: X-Amz-Date: 20200511T171838Z
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Accept-Encoding: gzip
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Action=DescribeImages&ImageId.1=ami-07dc734dc14746eab&Version=2016-11-15
2020-05-11T22:48:38.553+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: -----------------------------------------------------
2020-05-11T22:48:39.761+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:39 [DEBUG] [aws-sdk-go] DEBUG: Response ec2/DescribeImages Details:
2020-05-11T22:48:39.761+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: ---[ RESPONSE ]--------------------------------------
2020-05-11T22:48:39.761+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: HTTP/1.1 200 OK
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Connection: close
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Transfer-Encoding: chunked
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Content-Type: text/xml;charset=UTF-8
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Date: Mon, 11 May 2020 17:18:39 GMT
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Server: AmazonEC2
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Vary: accept-encoding
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: X-Amzn-Requestid: 87d3ddcf-aacd-43fe-a7c2-3efb44d6d76b
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: -----------------------------------------------------
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:39 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: <DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     <requestId>87d3ddcf-aacd-43fe-a7c2-3efb44d6d76b</requestId>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     <imagesSet>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         <item>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <imageId>ami-07dc734dc14746eab</imageId>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <imageLocation>099720109477/ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190212.1</imageLocation>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <imageState>available</imageState>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <imageOwnerId>099720109477</imageOwnerId>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <creationDate>2019-02-13T12:48:49.000Z</creationDate>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <isPublic>true</isPublic>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <architecture>x86_64</architecture>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <imageType>machine</imageType>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <sriovNetSupport>simple</sriovNetSupport>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <name>ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190212.1</name>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <description>Canonical, Ubuntu, 18.04 LTS, amd64 bionic image build on 2019-02-12</description>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <rootDeviceType>ebs</rootDeviceType>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <rootDeviceName>/dev/sda1</rootDeviceName>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <blockDeviceMapping>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 <item>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <deviceName>/dev/sda1</deviceName>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <ebs>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                         <snapshotId>snap-0160fe9487706c145</snapshotId>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                         <volumeSize>8</volumeSize>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                         <deleteOnTermination>true</deleteOnTermination>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                         <volumeType>gp2</volumeType>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                         <encrypted>false</encrypted>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     </ebs>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 </item>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 <item>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <deviceName>/dev/sdb</deviceName>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <virtualName>ephemeral0</virtualName>
2020-05-11T22:48:39.762+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 </item>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 <item>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <deviceName>/dev/sdc</deviceName>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                     <virtualName>ephemeral1</virtualName>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:                 </item>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             </blockDeviceMapping>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <virtualizationType>hvm</virtualizationType>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <hypervisor>xen</hypervisor>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <enaSupport>true</enaSupport>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <platformDetails>Linux/UNIX</platformDetails>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:             <usageOperation>RunInstances</usageOperation>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         </item>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     </imagesSet>
2020-05-11T22:48:39.763+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: </DescribeImagesResponse>
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:39 [DEBUG] Run configuration: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   BlockDeviceMappings: [{
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       DeviceName: "/dev/sda1",
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       Ebs: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         DeleteOnTermination: true,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         VolumeSize: 260,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         VolumeType: "gp2"
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       }
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     },{
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       DeviceName: "/dev/sda1",
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       Ebs: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         DeleteOnTermination: true,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         VolumeSize: 260,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:         VolumeType: "gp2"
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:       }
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     }],
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   DisableApiTermination: false,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   EbsOptimized: true,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   HibernationOptions: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     Configured: false
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   },
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   IamInstanceProfile: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     Name: ""
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   },
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   ImageId: "ami-07dc734dc14746eab",
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   InstanceType: "t2.micro",
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   MaxCount: 1,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   MinCount: 1,
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   Monitoring: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     Enabled: false
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   },
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   Placement: {
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     AvailabilityZone: "",
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:     GroupName: ""
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:   }
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: }
2020-05-11T22:48:39.782+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:39 [DEBUG] Waiting for state to become: [success]
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:39 [DEBUG] [aws-sdk-go] DEBUG: Request ec2/RunInstances Details:
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: ---[ REQUEST POST-SIGN ]-----------------------------
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: POST / HTTP/1.1
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Host: ec2.eu-west-2.amazonaws.com
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: User-Agent: aws-sdk-go/1.30.21 (go1.13.7; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.12.24 (+https://www.terraform.io)
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Content-Length: 645
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Content-Type: application/x-www-form-urlencoded; charset=utf-8
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: X-Amz-Date: 20200511T171839Z
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Accept-Encoding: gzip
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Action=RunInstances&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true&BlockDeviceMapping.1.Ebs.VolumeSize=260&BlockDeviceMapping.1.Ebs.VolumeType=gp2&BlockDeviceMapping.2.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.2.Ebs.DeleteOnTermination=true&BlockDeviceMapping.2.Ebs.VolumeSize=260&BlockDeviceMapping.2.Ebs.VolumeType=gp2&DisableApiTermination=false&EbsOptimized=true&HibernationOptions.Configured=false&IamInstanceProfile.Name=&ImageId=ami-07dc734dc14746eab&InstanceType=t2.micro&MaxCount=1&MinCount=1&Monitoring.Enabled=false&Placement.AvailabilityZone=&Placement.GroupName=&Version=2016-11-15
2020-05-11T22:48:39.790+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: -----------------------------------------------------
2020/05/11 22:48:40 [TRACE] dag/walk: vertex "root" is waiting for "meta.count-boundary (EachMode fixup)"
2020/05/11 22:48:40 [TRACE] dag/walk: vertex "meta.count-boundary (EachMode fixup)" is waiting for "aws_instance.test-instance1"
2020/05/11 22:48:40 [TRACE] dag/walk: vertex "provider.aws (close)" is waiting for "aws_instance.test-instance1"
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:41 [DEBUG] [aws-sdk-go] DEBUG: Response ec2/RunInstances Details:
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: ---[ RESPONSE ]--------------------------------------
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: HTTP/1.1 400 Bad Request
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Connection: close
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Transfer-Encoding: chunked
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Date: Mon, 11 May 2020 17:18:41 GMT
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: Server: AmazonEC2
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: -----------------------------------------------------
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:41 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?>
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: <Response><Errors><Error><Code>Unsupported</Code><Message>The requested configuration is currently not supported. Please check the documentation for supported configurations.</Message></Error></Errors><RequestID>1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5</RequestID></Response>
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4: 2020/05/11 22:48:41 [DEBUG] [aws-sdk-go] DEBUG: Validate Response ec2/RunInstances failed, attempt 0/25, error Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
2020-05-11T22:48:41.622+0530 [DEBUG] plugin.terraform-provider-aws_v2.61.0_x4:  status code: 400, request id: 1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5
2020/05/11 22:48:41 [DEBUG] aws_instance.test-instance1: apply errored, but we're indicating that via the Error pointer rather than returning it: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: 1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/05/11 22:48:41 [TRACE] EvalMaybeTainted: aws_instance.test-instance1 encountered an error during creation, so it is now marked as tainted
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/05/11 22:48:41 [TRACE] EvalWriteState: removing state object for aws_instance.test-instance1
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2020/05/11 22:48:41 [TRACE] EvalApplyProvisioners: aws_instance.test-instance1 has no state, so skipping provisioners
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/05/11 22:48:41 [TRACE] EvalMaybeTainted: aws_instance.test-instance1 encountered an error during creation, so it is now marked as tainted
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalWriteState
2020/05/11 22:48:41 [TRACE] EvalWriteState: removing state object for aws_instance.test-instance1
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalIf
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalIf
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2020/05/11 22:48:41 [TRACE] <root>: eval: *terraform.EvalApplyPost
2020/05/11 22:48:41 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: 1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5
2020/05/11 22:48:41 [ERROR] <root>: eval: *terraform.EvalSequence, err: Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
status code: 400, request id: 1db1f3f0-88c5-4d71-bf9d-43f3a987b5c5
2020/05/11 22:48:41 [TRACE] [walkApply] Exiting eval tree: aws_instance.test-instance1
2020/05/11 22:48:41 [TRACE] vertex "aws_instance.test-instance1": visit complete
2020/05/11 22:48:41 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/05/11 22:48:41 [TRACE] dag/walk: upstream of "provider.aws (close)" errored, so skipping
2020/05/11 22:48:41 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/05/11 22:48:41 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2020/05/11 22:48:41 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2020/05/11 22:48:41 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2020/05/11 22:48:41 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2020/05/11 22:48:41 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2020-05-11T22:48:41.683+0530 [DEBUG] plugin: plugin exited

我的猜测是t2类型实例不支持每 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html#ebs-optimization-support 的 EBS 优化卷。尝试删除ebs_optimized或将其设置为false

instance_type = "t2.micro">

更改为

instance_type = "t3.micro">

对我来说还可以。

相关内容

最新更新