Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetics Test missing metadata input for multi-step API test #2155

Closed
Nuru opened this issue Oct 20, 2023 · 2 comments
Closed

Synthetics Test missing metadata input for multi-step API test #2155

Nuru opened this issue Oct 20, 2023 · 2 comments
Labels

Comments

@Nuru
Copy link

Nuru commented Oct 20, 2023

Datadog Terraform Provider Version

3.30.0

Terraform Version

1.3.9

What resources or data sources are affected?

datadog_synthetics_test

Terraform Configuration Files

bug.tf (click to reveal)

Note, this was copied from the Terraform resource documentation. The only change was to add request_metadata.

resource "datadog_synthetics_test" "test_multi_step" {
  name      = "Multistep API test"
  type      = "api"
  subtype   = "multi"
  status    = "live"
  locations = ["aws:eu-central-1"]
  tags      = ["foo:bar", "foo", "env:test"]

  api_step {
    name    = "An API test on example.org"
    subtype = "http"

    assertion {
      type     = "statusCode"
      operator = "is"
      target   = "200"
    }

    request_metadata = {}

    request_definition {
      method = "GET"
      url    = "https://example.org"
    }

    request_headers = {
      Content-Type   = "application/json"
      Authentication = "Token: 1234566789"
    }
  }

  api_step {
    name    = "An API test on example.org"
    subtype = "http"

    assertion {
      type     = "statusCode"
      operator = "is"
      target   = "200"
    }

    request_definition {
      method = "GET"
      url    = "http://example.org"
    }
  }

  options_list {
    tick_every         = 900
    accept_self_signed = true
  }
}

Relevant debug or panic output

│ Error: Unsupported argument
│ 
│   on bug.tf line 19, in resource "datadog_synthetics_test" "test_multi_step":
│   19:     request_metadata = {}
│ 
│ An argument named "request_metadata" is not expected here.

Expected Behavior

The api_step block should accept a metadata or request_metadata input, to match the REST API input config.steps[].request.metadata input.

Actual Behavior

Neither metadata nor request_metadata inputs are accepted in api_step blocks.

Steps to Reproduce

terraform plan

@Nuru Nuru added the bug label Oct 20, 2023
@nkzou
Copy link
Contributor

nkzou commented Nov 17, 2023

From my understanding, the metadata field is only used for gRPC tests. The description in the docs says Metadata to include when performing the gRPC test., while multi-step synthetic tests only support http requests at this time. As such I don't think there's a need to implement this now, but we will revisit this if multi-step tests ever do support gRPC.
Closing this for now but please reopen if I'm mistaken about anything, thanks!

@nkzou nkzou closed this as completed Nov 17, 2023
@Joapfel
Copy link

Joapfel commented Jan 5, 2024

Hi @nkzou , it seems that Datadog itself already supports grpc in multistep api tests. Are you planning to provide support from Terraform side anytime soon? Where can I place a feature request?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants