【发布时间】:2021-12-02 21:21:13
【问题描述】:
Terraform 新手在这里。
我正在使用Terraform in Action 书籍here。当我运行terraform apply 时,我收到VPCIdNotSpecified: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC 错误。我已经安装了 AWS CLI 并使用 aws configure 配置了我的 AWS 凭证。我的 AWS 凭证存在于 %UserProfile%\.aws\credentials 文件中。
我错过了什么?
main.tf
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "helloworld" {
ami = "ami-09dd2e08d601bff67"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
错误堆栈跟踪:
aws_instance.helloworld: Creating...
╷
│ Error: Error launching source instance: VPCIdNotSpecified: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC.
│ status code: 400, request id: 1e0911db-300b-4c00-aea1-dad588bbe40e
│
│ with aws_instance.helloworld,
│ on main.tf line 4, in resource "aws_instance" "helloworld":
│ 4: resource "aws_instance" "helloworld" {
│
【问题讨论】:
标签: amazon-web-services terraform terraform-provider-aws