mirror of
https://github.com/hashicorp/terraform.git
synced 2026-03-22 18:33:08 -04:00
This helps us catch diagnostics in locals that only happen during evaluation Co-authored-by: Mutahhir Hayat <mutahhir.hayat@hashicorp.com> Co-authored-by: Matej Risek <matej.risek@hashicorp.com>
31 lines
544 B
HCL
31 lines
544 B
HCL
required_providers {
|
|
testing = {
|
|
source = "hashicorp/testing"
|
|
version = "0.1.0"
|
|
}
|
|
}
|
|
|
|
provider "testing" "main" {}
|
|
|
|
variable "in" {
|
|
type = object({
|
|
name = string
|
|
})
|
|
}
|
|
|
|
locals {
|
|
# This is not caught during the config evaluation but only when we try to
|
|
# evaluate this value during planning / applying.
|
|
invalid_local = { for k, v in var.in : k => v + 3 }
|
|
}
|
|
|
|
component "self" {
|
|
source = "./"
|
|
inputs = {
|
|
name = "example#{local.invalid_local}"
|
|
}
|
|
|
|
providers = {
|
|
testing = provider.testing.main
|
|
}
|
|
}
|