Complete the code to specify the Terraform provider source.
terraform {
required_providers {
aws = {
source = "[1]"
version = "~> 4.0"
}
}
}The correct source for the AWS provider is hashicorp/aws. This tells Terraform to use the official AWS provider from HashiCorp.
Complete the code to configure a provider mirror for Terraform.
provider_installation {
filesystem_mirror {
path = "[1]"
include = ["hashicorp/*"]
}
direct {
exclude = ["hashicorp/*"]
}
}The path should point to the directory where the provider mirror is stored. /mnt/terraform-providers is a common example path.
Fix the error in the provider installation block to correctly enable the mirror.
provider_installation {
[1] {
path = "/mnt/terraform-providers"
include = ["hashicorp/*"]
}
direct {
exclude = ["hashicorp/*"]
}
}The correct block name is filesystem_mirror. Other names will cause Terraform to fail parsing the configuration.
Fill both blanks to configure Terraform to use a mirror and fallback to direct installation.
provider_installation {
[1] {
path = "/opt/terraform/providers"
include = ["[2]"]
}
direct {}
}The block filesystem_mirror is used to specify a local mirror path. The include pattern hashicorp/* matches all providers from HashiCorp.
Fill all three blanks to configure Terraform with a mirror path, include pattern, and exclude pattern.
provider_installation {
[1] {
path = "/data/terraform/providers"
include = ["[2]"]
}
direct {
exclude = ["[3]"]
}
}The filesystem_mirror block defines the mirror path. The include pattern hashicorp/* specifies which providers to use from the mirror. The direct block excludes custom/* providers from direct download, forcing them to use the mirror or fail.