Feature/schema v3 support #3141
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for the v3 schema in Datadog service definitions, including validation, testing, and example configurations. The changes ensure compatibility with the new schema version and add comprehensive testing to validate its functionality.
Added support for v3 schema in service definitions:
datadog/resource_datadog_service_definition_yaml_resource_test.go
: Added unit tests to validate the v3 schema, including schema configuration, validation, and state normalization. The tests ensure that theservice_definition
field is required, of type string, and properly validates v3 YAML.datadog/service_definition_validation_test.go
: Added tests to validate various schema versions (v2, v2.1, v2.2, v3, v3.1) and error cases (e.g., missingschema-version
ordd-service
).Integration tests for v3 schema:
datadog/tests/resource_datadog_service_definition_yaml_test.go
: Added an acceptance testTestAccDatadogServiceDefinition_BasicV3
to verify the functionality of v3 schema service definitions. This includes creating, reading, and destroying resources.datadog/tests/resource_datadog_service_definition_yaml_test.go
: Added a helper functiontestAccCheckDatadogServiceDefinitionV3
to define a sample v3 schema resource for testing purposes. It includes fields likecontacts
,integrations
,links
,tags
, andextensions
.Example configuration for v3 schema:
examples/resources/datadog_service_definition_yaml/resource.tf
: Added an example resource configuration demonstrating the v3 schema. This includes fields such ascontacts
,description
,languages
,integrations
,extensions
, and more, tailored for a shopping cart service.This pull request is to deal with #2417