From 1a07424f7a2383788a96b786dd0198b4633162b2 Mon Sep 17 00:00:00 2001 From: Corentin Girard Date: Fri, 16 Aug 2024 21:36:18 +0200 Subject: [PATCH] [datadog_synthetics_test] Do not send `field` if empty (#2533) --- datadog/resource_datadog_synthetics_test_.go | 5 +- ...dogSyntheticsTestMultistepApi_Basic.freeze | 2 +- ...tadogSyntheticsTestMultistepApi_Basic.yaml | 70 +++++++++---------- .../resource_datadog_synthetics_test_test.go | 40 ++++++++--- 4 files changed, 69 insertions(+), 48 deletions(-) diff --git a/datadog/resource_datadog_synthetics_test_.go b/datadog/resource_datadog_synthetics_test_.go index 9d489d0cbc..5d7cb745a8 100644 --- a/datadog/resource_datadog_synthetics_test_.go +++ b/datadog/resource_datadog_synthetics_test_.go @@ -2934,9 +2934,12 @@ func buildDatadogExtractedValues(stepExtractedValues []interface{}) []datadogV1. value := datadogV1.SyntheticsParsingOptions{} value.SetName(extractedValueMap["name"].(string)) - value.SetField(extractedValueMap["field"].(string)) value.SetType(datadogV1.SyntheticsGlobalVariableParseTestOptionsType(extractedValueMap["type"].(string))) + if extractedValueMap["field"] != "" { + value.SetField(extractedValueMap["field"].(string)) + } + valueParsers := extractedValueMap["parser"].([]interface{}) valueParser := valueParsers[0].(map[string]interface{}) diff --git a/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.freeze b/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.freeze index d311abd739..cb10121662 100644 --- a/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.freeze +++ b/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.freeze @@ -1 +1 @@ -2024-08-01T22:13:00.200996+02:00 \ No newline at end of file +2024-08-16T16:46:49.886954+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.yaml b/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.yaml index 361eff2621..bbeb85230d 100644 --- a/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.yaml +++ b/datadog/tests/cassettes/TestAccDatadogSyntheticsTestMultistepApi_Basic.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"description":"a global variable","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","tags":["foo:bar","baz"],"value":{"secure":false,"value":"variable-value"}} + {"description":"a global variable","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","tags":["foo:bar","baz"],"value":{"secure":false,"value":"variable-value"}} form: {} headers: Accept: @@ -32,13 +32,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"parse_test_public_id":null,"parse_test_name":null,"parse_test_options":null,"parse_test_extracted_at":null,"last_error":null,"value":{"secure":false,"value":"variable-value"}} + {"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"last_error":null,"value":{"secure":false,"value":"variable-value"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 444.550958ms + duration: 453.0355ms - id: 1 request: proto: HTTP/1.1 @@ -55,7 +55,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/variables/43883ccf-136d-4a4c-b6c3-8d2e2e0520f7 + url: https://api.datadoghq.com/api/v1/synthetics/variables/e0da7993-a9f0-45de-af3f-10e726239bcd method: GET response: proto: HTTP/1.1 @@ -67,13 +67,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-01T20:13:03.670663+00:00","modified_at":"2024-08-01T20:13:03.670663+00:00","parse_test_public_id":null,"parse_test_name":null,"parse_test_options":null,"parse_test_extracted_at":null,"last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-16T14:46:51.843385+00:00","modified_at":"2024-08-16T14:46:51.843385+00:00","last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 169.416ms + duration: 153.003708ms - id: 2 request: proto: HTTP/1.1 @@ -90,7 +90,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/variables/43883ccf-136d-4a4c-b6c3-8d2e2e0520f7 + url: https://api.datadoghq.com/api/v1/synthetics/variables/e0da7993-a9f0-45de-af3f-10e726239bcd method: GET response: proto: HTTP/1.1 @@ -102,26 +102,26 @@ interactions: content_length: -1 uncompressed: true body: | - {"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-01T20:13:03.670663+00:00","modified_at":"2024-08-01T20:13:03.670663+00:00","parse_test_public_id":null,"parse_test_name":null,"parse_test_options":null,"parse_test_extracted_at":null,"last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-16T14:46:51.843385+00:00","modified_at":"2024-08-16T14:46:51.843385+00:00","last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 159.622708ms + duration: 171.297ms - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 4345 + content_length: 4459 transfer_encoding: [] trailer: {} host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"config":{"assertions":[],"configVariables":[{"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"field":"content-length","name":"VAR_EXTRACT","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"content":"content-certificate","filename":"Provided in Terraform config"},"key":{"content":"content-key","filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc"},{"name":"Wait step","subtype":"wait","value":5}]},"locations":["aws:eu-central-1"],"message":"Notify @datadog.user","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1722543180","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"status":"paused","subtype":"multi","tags":["multistep"],"type":"api"} + {"config":{"assertions":[],"configVariables":[{"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"name":"VAR_EXTRACT_BODY","parser":{"type":"json_path","value":"$.id"},"secure":false,"type":"http_body"},{"field":"content-length","name":"VAR_EXTRACT_HEADER","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"content":"content-certificate","filename":"Provided in Terraform config"},"key":{"content":"content-key","filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc"},{"name":"Wait step","subtype":"wait","value":5}]},"locations":["aws:eu-central-1"],"message":"Notify @datadog.user","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1723819609","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"status":"paused","subtype":"multi","tags":["multistep"],"type":"api"} form: {} headers: Accept: @@ -140,13 +140,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"public_id":"ryw-xk5-wit","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1722543180","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-01T20:13:04.550319+00:00","modified_at":"2024-08-01T20:13:04.550319+00:00","config":{"assertions":[],"configVariables":[{"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"field":"content-length","name":"VAR_EXTRACT","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"5f5-n25-95z"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"ve5-gf7-cjd"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"5pw-k4j-n8f"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"jpd-ynt-hd3"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"5kd-pu5-45x"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"ib6-wni-k9k"},{"name":"Wait step","subtype":"wait","value":5,"id":"25t-7t5-f25"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150372477,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"public_id":"hv3-qu6-ibk","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1723819609","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-16T14:46:52.703572+00:00","modified_at":"2024-08-16T14:46:52.703572+00:00","config":{"assertions":[],"configVariables":[{"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"name":"VAR_EXTRACT_BODY","parser":{"type":"json_path","value":"$.id"},"secure":false,"type":"http_body"},{"field":"content-length","name":"VAR_EXTRACT_HEADER","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"cq6-m8x-t7k"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"s5m-vkt-yf5"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"hwh-5ku-hwm"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"32w-2k2-pgr"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"i3t-yry-w7y"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"hcj-mcq-5xf"},{"name":"Wait step","subtype":"wait","value":5,"id":"wm5-dny-7vd"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":151569084,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 518.625334ms + duration: 531.17775ms - id: 4 request: proto: HTTP/1.1 @@ -163,7 +163,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/tests/api/ryw-xk5-wit + url: https://api.datadoghq.com/api/v1/synthetics/tests/api/hv3-qu6-ibk method: GET response: proto: HTTP/1.1 @@ -175,13 +175,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"public_id":"ryw-xk5-wit","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1722543180","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-01T20:13:04.550319+00:00","modified_at":"2024-08-01T20:13:04.550319+00:00","config":{"assertions":[],"configVariables":[{"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"field":"content-length","name":"VAR_EXTRACT","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"5f5-n25-95z"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"ve5-gf7-cjd"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"5pw-k4j-n8f"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"jpd-ynt-hd3"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"5kd-pu5-45x"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"ib6-wni-k9k"},{"name":"Wait step","subtype":"wait","value":5,"id":"25t-7t5-f25"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":150372477,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"public_id":"hv3-qu6-ibk","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1723819609","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-16T14:46:52.703572+00:00","modified_at":"2024-08-16T14:46:52.703572+00:00","config":{"assertions":[],"configVariables":[{"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"name":"VAR_EXTRACT_BODY","parser":{"type":"json_path","value":"$.id"},"secure":false,"type":"http_body"},{"field":"content-length","name":"VAR_EXTRACT_HEADER","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"cq6-m8x-t7k"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"s5m-vkt-yf5"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"hwh-5ku-hwm"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"32w-2k2-pgr"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"i3t-yry-w7y"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"hcj-mcq-5xf"},{"name":"Wait step","subtype":"wait","value":5,"id":"wm5-dny-7vd"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":151569084,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 159.272459ms + duration: 151.807541ms - id: 5 request: proto: HTTP/1.1 @@ -198,7 +198,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/variables/43883ccf-136d-4a4c-b6c3-8d2e2e0520f7 + url: https://api.datadoghq.com/api/v1/synthetics/variables/e0da7993-a9f0-45de-af3f-10e726239bcd method: GET response: proto: HTTP/1.1 @@ -210,13 +210,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-01T20:13:03.670663+00:00","modified_at":"2024-08-01T20:13:03.670663+00:00","parse_test_public_id":null,"parse_test_name":null,"parse_test_options":null,"parse_test_extracted_at":null,"last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-16T14:46:51.843385+00:00","modified_at":"2024-08-16T14:46:51.843385+00:00","last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 166.754375ms + duration: 161.136458ms - id: 6 request: proto: HTTP/1.1 @@ -233,7 +233,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/variables/43883ccf-136d-4a4c-b6c3-8d2e2e0520f7 + url: https://api.datadoghq.com/api/v1/synthetics/variables/e0da7993-a9f0-45de-af3f-10e726239bcd method: GET response: proto: HTTP/1.1 @@ -245,13 +245,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1722543180","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-01T20:13:03.670663+00:00","modified_at":"2024-08-01T20:13:03.670663+00:00","parse_test_public_id":null,"parse_test_name":null,"parse_test_options":null,"parse_test_extracted_at":null,"last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"TF_TESTACCDATADOGSYNTHETICSTESTMULTISTEPAPI_BASIC_LOCAL_1723819609","description":"a global variable","type":"variable","tags":["foo:bar","baz"],"created_at":"2024-08-16T14:46:51.843385+00:00","modified_at":"2024-08-16T14:46:51.843385+00:00","last_error":null,"value":{"secure":false,"value":"variable-value"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"editor":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 160.677ms + duration: 156.021542ms - id: 7 request: proto: HTTP/1.1 @@ -268,7 +268,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/tests/ryw-xk5-wit + url: https://api.datadoghq.com/api/v1/synthetics/tests/hv3-qu6-ibk method: GET response: proto: HTTP/1.1 @@ -280,13 +280,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"public_id":"ryw-xk5-wit","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1722543180","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-01T20:13:04.550319+00:00","modified_at":"2024-08-01T20:13:04.550319+00:00","config":{"assertions":[],"configVariables":[{"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"field":"content-length","name":"VAR_EXTRACT","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"5f5-n25-95z"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"ve5-gf7-cjd"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"5pw-k4j-n8f"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"jpd-ynt-hd3"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"5kd-pu5-45x"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"ib6-wni-k9k"},{"name":"Wait step","subtype":"wait","value":5,"id":"25t-7t5-f25"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":150372477,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"public_id":"hv3-qu6-ibk","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1723819609","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-16T14:46:52.703572+00:00","modified_at":"2024-08-16T14:46:52.703572+00:00","config":{"assertions":[],"configVariables":[{"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"name":"VAR_EXTRACT_BODY","parser":{"type":"json_path","value":"$.id"},"secure":false,"type":"http_body"},{"field":"content-length","name":"VAR_EXTRACT_HEADER","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"cq6-m8x-t7k"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"s5m-vkt-yf5"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"hwh-5ku-hwm"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"32w-2k2-pgr"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"i3t-yry-w7y"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"hcj-mcq-5xf"},{"name":"Wait step","subtype":"wait","value":5,"id":"wm5-dny-7vd"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":151569084,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 159.864666ms + duration: 153.630834ms - id: 8 request: proto: HTTP/1.1 @@ -303,7 +303,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/tests/api/ryw-xk5-wit + url: https://api.datadoghq.com/api/v1/synthetics/tests/api/hv3-qu6-ibk method: GET response: proto: HTTP/1.1 @@ -315,13 +315,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"public_id":"ryw-xk5-wit","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1722543180","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-01T20:13:04.550319+00:00","modified_at":"2024-08-01T20:13:04.550319+00:00","config":{"assertions":[],"configVariables":[{"id":"43883ccf-136d-4a4c-b6c3-8d2e2e0520f7","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"field":"content-length","name":"VAR_EXTRACT","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"5f5-n25-95z"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"ve5-gf7-cjd"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"5pw-k4j-n8f"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"jpd-ynt-hd3"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"5kd-pu5-45x"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"ib6-wni-k9k"},{"name":"Wait step","subtype":"wait","value":5,"id":"25t-7t5-f25"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":150372477,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} + {"public_id":"hv3-qu6-ibk","name":"tf-TestAccDatadogSyntheticsTestMultistepApi_Basic-local-1723819609","status":"paused","type":"api","tags":["multistep"],"created_at":"2024-08-16T14:46:52.703572+00:00","modified_at":"2024-08-16T14:46:52.703572+00:00","config":{"assertions":[],"configVariables":[{"id":"e0da7993-a9f0-45de-af3f-10e726239bcd","name":"VARIABLE_NAME","type":"global"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"extractedValues":[{"name":"VAR_EXTRACT_BODY","parser":{"type":"json_path","value":"$.id"},"secure":false,"type":"http_body"},{"field":"content-length","name":"VAR_EXTRACT_HEADER","parser":{"type":"regex","value":".*"},"secure":true,"type":"http_header"}],"isCritical":false,"name":"First api step","request":{"allow_insecure":true,"basicAuth":{"accessKey":"sigv4-access-key","region":"sigv4-region","secretKey":"sigv4-secret-key","serviceName":"sigv4-service-name","sessionToken":"sigv4-session-token","type":"sigv4"},"body":"this is a body","certificate":{"cert":{"filename":"Provided in Terraform config"},"key":{"filename":"key"}},"follow_redirects":true,"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"httpVersion":"http2","method":"POST","noSavingResponseBody":true,"persistCookies":false,"proxy":{"headers":{"Accept":"application/json","X-Datadog-Trace-ID":"123456789"},"url":"https://proxy.url"},"query":{"foo":"bar"},"timeout":30,"url":"https://www.datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"cq6-m8x-t7k"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Second api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","scope":"scope","tokenApiAuthentication":"header","type":"oauth-client"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"s5m-vkt-yf5"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Third api step","request":{"allow_insecure":true,"basicAuth":{"accessTokenUrl":"https://token.datadoghq.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","password":"password","resource":"resource","scope":"scope","tokenApiAuthentication":"body","type":"oauth-rop","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"hwh-5ku-hwm"},{"allowFailure":false,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[],"isCritical":false,"name":"Fourth api step","request":{"allow_insecure":true,"basicAuth":{"password":"password","type":"digest","username":"username"},"follow_redirects":true,"httpVersion":"any","method":"GET","noSavingResponseBody":false,"persistCookies":false,"timeout":30,"url":"https://docs.datadoghq.com"},"subtype":"http","id":"32w-2k2-pgr"},{"allowFailure":false,"assertions":[{"operator":"is","target":1,"type":"grpcHealthcheckStatus"}],"extractedValues":[],"isCritical":false,"name":"gRPC health check step","request":{"allow_insecure":false,"callType":"healthcheck","host":"https://docs.datadoghq.com","message":"","metadata":{"foo":"bar"},"method":"","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"i3t-yry-w7y"},{"allowFailure":false,"assertions":[{"operator":"validatesJSONPath","target":{"elementsOperator":"firstElementMatches","jsonPath":"$.message","operator":"is","targetValue":"Hello, John!"},"type":"grpcProto"}],"extractedValues":[],"isCritical":false,"name":"gRPC behavior check step","request":{"allow_insecure":false,"callType":"unary","compressedProtoFile":"eJwqzs9NVSgoyi/JV0jLzEkFBAAA//8u0wXJ","host":"https://docs.datadoghq.com","message":"{\"name\": \"John\"}","metadata":{"foo":"bar"},"method":"SayHello","port":443,"service":"greeter.Greeter","timeout":0},"subtype":"grpc","id":"hcj-mcq-5xf"},{"name":"Wait step","subtype":"wait","value":5,"id":"wm5-dny-7vd"}]},"message":"Notify @datadog.user","options":{"httpVersion":"any","min_location_failed":1,"tick_every":900},"locations":["aws:eu-central-1"],"subtype":"multi","monitor_id":151569084,"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 173.896625ms + duration: 156.081792ms - id: 9 request: proto: HTTP/1.1 @@ -334,7 +334,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"public_ids":["ryw-xk5-wit"]} + {"public_ids":["hv3-qu6-ibk"]} form: {} headers: Accept: @@ -353,13 +353,13 @@ interactions: content_length: -1 uncompressed: true body: | - {"deleted_tests":[{"public_id":"ryw-xk5-wit","deleted_at":"2024-08-01T20:13:07.475704+00:00"}]} + {"deleted_tests":[{"public_id":"hv3-qu6-ibk","deleted_at":"2024-08-16T14:46:55.514876+00:00"}]} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 683.84775ms + duration: 1.614070833s - id: 10 request: proto: HTTP/1.1 @@ -376,7 +376,7 @@ interactions: headers: Accept: - '*/*' - url: https://api.datadoghq.com/api/v1/synthetics/variables/43883ccf-136d-4a4c-b6c3-8d2e2e0520f7 + url: https://api.datadoghq.com/api/v1/synthetics/variables/e0da7993-a9f0-45de-af3f-10e726239bcd method: DELETE response: proto: HTTP/1.1 @@ -392,7 +392,7 @@ interactions: - text/html; charset=utf-8 status: 200 OK code: 200 - duration: 193.811417ms + duration: 190.380667ms - id: 11 request: proto: HTTP/1.1 @@ -409,7 +409,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/synthetics/tests/ryw-xk5-wit + url: https://api.datadoghq.com/api/v1/synthetics/tests/hv3-qu6-ibk method: GET response: proto: HTTP/1.1 @@ -426,4 +426,4 @@ interactions: - application/json status: 404 Not Found code: 404 - duration: 140.639042ms + duration: 130.02275ms diff --git a/datadog/tests/resource_datadog_synthetics_test_test.go b/datadog/tests/resource_datadog_synthetics_test_test.go index 56ac84f71c..b7bfb4a554 100644 --- a/datadog/tests/resource_datadog_synthetics_test_test.go +++ b/datadog/tests/resource_datadog_synthetics_test_test.go @@ -4557,19 +4557,31 @@ func createSyntheticsMultistepAPITest(ctx context.Context, accProvider func() (* resource.TestCheckResourceAttr( "datadog_synthetics_test.multi", "api_step.0.assertion.1.targetjsonschema.0.metaschema", "draft-07"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.#", "1"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.#", "2"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.name", "VAR_EXTRACT"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.name", "VAR_EXTRACT_BODY"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.type", "http_header"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.type", "http_body"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.field", "content-length"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.field", ""), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.parser.0.type", "regex"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.parser.0.type", "json_path"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.parser.0.value", ".*"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.parser.0.value", "$.id"), resource.TestCheckResourceAttr( - "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.secure", "true"), + "datadog_synthetics_test.multi", "api_step.0.extracted_value.0.secure", "false"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.name", "VAR_EXTRACT_HEADER"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.type", "http_header"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.field", "content-length"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.parser.0.type", "regex"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.parser.0.value", ".*"), + resource.TestCheckResourceAttr( + "datadog_synthetics_test.multi", "api_step.0.extracted_value.1.secure", "true"), resource.TestCheckResourceAttr( "datadog_synthetics_test.multi", "api_step.0.allow_failure", "true"), resource.TestCheckResourceAttr( @@ -4783,7 +4795,6 @@ resource "datadog_synthetics_test" "multi" { operator = "is" target = "200" } - assertion { type = "body" operator = "validatesJSONSchema" @@ -4792,9 +4803,16 @@ resource "datadog_synthetics_test" "multi" { metaschema = "draft-07" } } - extracted_value { - name = "VAR_EXTRACT" + name = "VAR_EXTRACT_BODY" + type = "http_body" + parser { + type = "json_path" + value = "$.id" + } + } + extracted_value { + name = "VAR_EXTRACT_HEADER" field = "content-length" type = "http_header" parser { @@ -4805,12 +4823,12 @@ resource "datadog_synthetics_test" "multi" { } allow_failure = true is_critical = false - retry { count = 5 interval = 1000 } } + api_step { name = "Second api step" request_definition {