Skip to content

Datasource datadog_teams cannot be mocked #3316

@jleloup

Description

@jleloup

Datadog Terraform Provider Version

v3.78.0

Terraform Version

v1.13.3

What resources or data sources are affected?

datadog_teams

Terraform Configuration Files

override_data {
  target = data.datadog_teams.oncall
  values = {
    teams = [
      {
        id     = "10000000-0000-0000-0000-000000000000"
        name   = "Fake-Team"
        handle = "fake-team"
      }
    ]
  }
}

Relevant debug or panic output

https://gist.github.com/jleloup/cc371d34a98096d0f66fc8fa0929db24

Expected Behavior

Mocking datadog_teams provide a list of teams to Terraform tests similar to a real datasource execution.

Actual Behavior

datadog_teams mocks return an empty list of values.

Steps to Reproduce

  1. Create a mock based on a datadog_teams datasource
  2. Run a test using this mock

Important Factoids

No response

References

This issue is referenced in a Terraform issue related to mocking blocks from datasources: hashicorp/terraform#37862 (comment)

It is stated there that using blocks as datasources instead of attributes are considered incorrect and are to be replaced by structural attributes instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions