-
Notifications
You must be signed in to change notification settings - Fork 0
Bug: CustomType nested attributes silently ignore unknown attributes #74
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Unknown/invalid attributes in nested blocks using CustomType are silently ignored instead of being rejected with an error.
Reproduction
resource "doit_alert" "test" {
name = "test-alert"
config = {
metric = {
type = "basic"
value = "cost"
this_is_invalid = "should_fail" # Should cause an error!
}
time_interval = "month"
value = 1000
currency = "USD"
condition = "value"
operator = "gt"
}
}Expected Behavior
terraform plan should fail with "Unsupported argument" error.
Actual Behavior
terraform plan succeeds. The invalid attribute is silently discarded.
Root Cause
The schema uses CustomType: MetricType{} for nested blocks. While MetricValue.AttributeTypes() only defines specific attributes, the Terraform Plugin Framework does not reject extra attributes when using custom types.
Affected Resources
All resources with nested blocks using CustomType: doit_alert, doit_budget, doit_allocation, doit_report
References
- Test configuration:
.test/schema-validation-test/main.tf - Schema definition:
internal/provider/resource_alert/alert_resource_gen.go:84-105
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working