当我使用资源运行terraform apply
时
resource "aws_default_subnet" "my_az_default_subnet" {
availability_zone = "eu-north-1"
}
我得到错误:
aws_default_subnet.learntf_default_subnet: Creating...
Error: Default subnet not found
即使默认VPC和子网存在于指定的CCD_ 2〃中;eu-north-1";。
provider.tf
:
provider "aws" {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
region = "eu-north-1"
}
variables.tf
:
variable "aws_access_key" {}
variable "aws_secret_key" {}
network.tf
:
resource "aws_default_subnet" "learntf_default_subnet" {
availability_zone = "eu-north-1"
}
我的错误。它与合作。
resource "aws_default_subnet" "def_subnet" {
availability_zone = "eu-north-1a"
}