Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 2.32 KB

File metadata and controls

66 lines (43 loc) · 2.32 KB

Datadog Terraform Provider

For setup, building, and contribution guidelines, read DEVELOPMENT.md first.

Critical Rules

NEVER Use Raw Go Commands for Testing

# ALWAYS use Makefile targets:
make test                                              # Unit tests
RECORD=false TESTARGS="-run TestName" make testacc     # Acceptance tests

# Recording modes for acceptance tests:
# RECORD=false  - Use cassettes (fast, default)
# RECORD=true   - Record new cassettes
# RECORD=none   - Live API only

Raw go test bypasses gotestsum and test infrastructure.

Testing Details

For full testing details (unit vs acceptance, RECORD modes, examples), see TESTING.md. The Claude test runner skill also includes expanded test-running guidance.

ALWAYS Add Schema Descriptions

All schema attributes MUST have Description fields - required for make docs generation.

Project Structure

  • datadog/fwprovider/ - Framework resources, search here for new resource patterns
  • datadog/*.go - SDKv2 resources (legacy), do NOT use for new resources
  • datadog/internal/ - Shared utilities: validators, customtypes, fwutils, planmodifiers
  • datadog/tests/ - Acceptance tests
  • examples/ - HCL examples used by docs generation
  • docs/ - Auto-generated by make docs, do NOT edit directly

Generated Documentation Exceptions

Some docs are manually maintained and excluded from auto generation. Check scripts/generate-docs.sh for the current exclude_files list before editing any docs/ files.

Code Patterns

  • ALWAYS search datadog/fwprovider/ for existing patterns before implementing new ones
  • Use Blocks, not Nested Attributes for complex structures
  • Avoid ObjectType (breaks docs generation - no field description support)

Quality Gates

Quick Checks (before any commit)

  • make fmtcheck passes
  • make test passes

Full Validation (before push)

  • make docs && make check-docs passes
  • make vet and make errcheck pass
  • Acceptance tests pass with RECORD=none for changed resources
  • No sensitive data in logs or errors

PR Labels

  • Changelog: changelog/improvement, changelog/feature, changelog/bugfix, changelog/note, changelog/documentation or changelog/no-changelog
  • Title prefix: [datadog_resource_name] Description