Terraform · API Governance Rules
Terraform API Rules
Spectral linting rules defining API design standards and conventions for Terraform.
10 Rules
error 1
warn 8
info 1
Rule Categories
terraform
Rules
warn
terraform-jsonapi-content-type
HCP Terraform API endpoints should use JSON API content type (application/vnd.api+json)
$.paths..content
error
terraform-operation-ids-present
All operations must have operationId defined
$.paths.*[get,post,put,patch,delete]
warn
terraform-operation-id-casing
Operation IDs should use PascalCase
$.paths.*[get,post,put,patch,delete].operationId
warn
terraform-path-kebab-case
URL path segments should use kebab-case or path parameters
$.paths
warn
terraform-bearer-auth
HCP Terraform API uses bearer token authentication
$.components.securitySchemes.*
warn
terraform-response-200-or-201
Non-delete operations should have 200 or 201 responses
$.paths.*[get,post,patch]
warn
terraform-delete-204
DELETE operations should return 204 No Content
$.paths.*.delete
warn
terraform-parameter-descriptions
Path and query parameters should have descriptions
$.paths..parameters[*]
warn
terraform-tags-required
Each operation should have at least one tag
$.paths.*[get,post,put,patch,delete]
info
terraform-pagination-parameters
GET list operations should support pagination parameters
$.paths.*[get]