Skip to content

Conversation

@g-brizolier
Copy link
Contributor

PR by Bits
View Dev Agent Session

You can ask for changes by mentioning @DataDog in a comment.

Feedback (especially what can be better) welcome in #code-gen-aka-bits-dev-feedback!


What does this PR do?

Marks primary_keys, fields.name, and fields.type as Required on the datadog_reference_table resource schema. Previously these were Optional, which allowed Terraform plans to succeed without them, only to fail at apply time with a 400 Bad Request from the API:

{"errors":[{"status":"400","title":"BadRequest","detail":"attribute \"primary_keys\" is required"},{"status":"400","title":"Bad Request","detail":"attribute \"fields\" is required"}]}

Details

  • primary_keys: Changed from Optional to Required. The SizeAtLeast(1) validator was already present but was skipped for null (omitted) values since Optional attributes are null when not set. Making it Required ensures the validator always runs.
  • fields block: Already enforced by listvalidator.SizeAtLeast(1) on the ListNestedBlock (blocks produce empty lists, not null, so the validator always fires).
  • fields.name and fields.type: Changed from Optional to Required to match API requirements.
  • All attributes retain Computed: true for API read population.

Motivation

Reported via Slack — users hit 400 errors at terraform apply time because the provider accepted configs missing required schema attributes. This change surfaces the error at terraform validate/plan time instead.

Additional Notes

All existing tests and examples already specify these attributes, so no test changes are needed.

@g-brizolier g-brizolier requested a review from a team as a code owner February 11, 2026 15:42
@datadog-datadog-prod-us1
Copy link
Contributor

Bits AI Dev Agent Status: ✅ Done [Fix CI Errors] [View Dev Agent Session]

You can ask for changes by mentioning @DataDog in a comment.

@g-brizolier g-brizolier force-pushed the dd/fix/reference-table-require-schema branch from c8ec554 to 1e399a6 Compare February 11, 2026 16:38
@g-brizolier g-brizolier requested a review from a team as a code owner February 11, 2026 16:38
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants