From d71d4d08096c6facd1a7b41eded8aed8043c7957 Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Tue, 30 Mar 2021 13:36:22 -0400 Subject: [PATCH 1/4] recreate GCP resource if certain fields are updated --- datadog/internal/utils/utils.go | 1 + datadog/resource_datadog_integration_gcp.go | 13 + .../TestAccDatadogIntegrationGCP.freeze | 2 +- .../TestAccDatadogIntegrationGCP.yaml | 498 +++++++++++------- .../resource_datadog_integration_gcp_test.go | 45 ++ docs/resources/integration_gcp.md | 1 + 6 files changed, 379 insertions(+), 181 deletions(-) diff --git a/datadog/internal/utils/utils.go b/datadog/internal/utils/utils.go index 737d257fb4..ac693dda7a 100644 --- a/datadog/internal/utils/utils.go +++ b/datadog/internal/utils/utils.go @@ -12,6 +12,7 @@ import ( datadogV2 "github.com/DataDog/datadog-api-client-go/api/v2/datadog" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/meta" + "github.com/terraform-providers/terraform-provider-datadog/version" ) diff --git a/datadog/resource_datadog_integration_gcp.go b/datadog/resource_datadog_integration_gcp.go index 03c6e2cd0a..4c371d0d5e 100644 --- a/datadog/resource_datadog_integration_gcp.go +++ b/datadog/resource_datadog_integration_gcp.go @@ -23,17 +23,20 @@ func resourceDatadogIntegrationGcp() *schema.Resource { Description: "Your Google Cloud project ID found in your JSON service account key.", Type: schema.TypeString, Required: true, + ForceNew: true, }, "private_key_id": { Description: "Your private key ID found in your JSON service account key.", Type: schema.TypeString, Required: true, + ForceNew: true, }, "private_key": { Description: "Your private key name found in your JSON service account key.", Type: schema.TypeString, Required: true, Sensitive: true, + ForceNew: true, }, "client_email": { Description: "Your email found in your JSON service account key.", @@ -44,12 +47,19 @@ func resourceDatadogIntegrationGcp() *schema.Resource { Description: "Your ID found in your JSON service account key.", Type: schema.TypeString, Required: true, + ForceNew: true, }, "host_filters": { Description: "Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.", Type: schema.TypeString, Optional: true, }, + "automute": { + Description: "Silence monitors for expected GCE instance shutdowns.", + Type: schema.TypeBool, + Default: false, + Optional: true, + }, }, } } @@ -72,6 +82,7 @@ func resourceDatadogIntegrationGcpCreate(d *schema.ResourceData, meta interface{ if _, _, err := datadogClientV1.GCPIntegrationApi.CreateGCPIntegration(authV1).Body( datadogV1.GCPAccount{ Type: datadogV1.PtrString(defaultType), + Automute: datadogV1.PtrBool(d.Get("automute").(bool)), ProjectId: datadogV1.PtrString(projectID), PrivateKeyId: datadogV1.PtrString(d.Get("private_key_id").(string)), PrivateKey: datadogV1.PtrString(d.Get("private_key").(string)), @@ -108,6 +119,7 @@ func resourceDatadogIntegrationGcpRead(d *schema.ResourceData, meta interface{}) d.Set("project_id", integration.GetProjectId()) d.Set("client_email", integration.GetClientEmail()) d.Set("host_filters", integration.GetHostFilters()) + d.Set("automute", integration.GetAutomute()) return nil } } @@ -125,6 +137,7 @@ func resourceDatadogIntegrationGcpUpdate(d *schema.ResourceData, meta interface{ ProjectId: datadogV1.PtrString(d.Id()), ClientEmail: datadogV1.PtrString(d.Get("client_email").(string)), HostFilters: datadogV1.PtrString(d.Get("host_filters").(string)), + Automute: datadogV1.PtrBool(d.Get("automute").(bool)), }, ).Execute(); err != nil { return utils.TranslateClientError(err, "error updating GCP integration") diff --git a/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.freeze b/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.freeze index 638c7078cb..562a42e3a8 100644 --- a/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.freeze +++ b/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.freeze @@ -1 +1 @@ -2020-12-31T15:42:48.983978+01:00 \ No newline at end of file +2021-03-30T13:30:54.526302-04:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.yaml b/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.yaml index f9c8d641da..b4c8a9f5df 100644 --- a/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.yaml +++ b/datadog/tests/cassettes/TestAccDatadogIntegrationGCP.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","automute":false,"client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} form: {} headers: Accept: @@ -13,14 +13,7 @@ interactions: Dd-Operation-Id: - CreateGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "7580219769874621141" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: POST response: @@ -37,20 +30,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:51 GMT + - Tue, 30 Mar 2021 17:30:55 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:49 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - IEUzjgpnyUrp74lH2dqPweGXNQU7es3CY44HHPIdy7aSNeimMebMvcKCoCgyWWVx + - mNzaoDhdDKO7t4QSrAe5X7pHd0bJND187D+vRbwoluXouE2m1UaQQX0RGCvRpLVE X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -65,18 +55,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "4846474724929156003" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -87,12 +70,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:52 GMT + - Tue, 30 Mar 2021 17:30:55 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:51 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -100,9 +80,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - LkSOFVoHBcsyBoPbYbYfcEWZoNcVif5SL5dX3LvvR/J4mRuKXGmrGqdm859yDQ2v + - l8RQo2maZqJf6GFThBbKNE6dvthz6njusVtau3dPXJWL2RLFoN81H+BLPB/1xgs1 X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -117,18 +97,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "1462595351394895797" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -139,12 +112,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:52 GMT + - Tue, 30 Mar 2021 17:30:55 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:52 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -152,9 +122,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - NAgpeopdgW9X30OuB191/muuvQIfRBmU7ohOgihh9xKnn0bCG7Kguc4bGAIB6OKr + - l8RQo2maZqJf6GFThBbKNE6dvthz6njusVtau3dPXJWL2RLFoN81H+BLPB/1xgs1 X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -169,18 +139,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "7718788102898467958" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -191,12 +154,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:53 GMT + - Tue, 30 Mar 2021 17:30:55 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:52 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -204,9 +164,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - hw3ZauSSamfHLo55DFwif1/mO6RiYSc0/libBchlIMnyWX9rK7JgS3Pek5rkz683 + - fIO2C4qGDheGHy4YbS+r3a3CXbh4cbRo7roILOimQyiHGjQdOat0cIpWCkupM1uX X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -221,18 +181,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "3932069661551817895" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -243,12 +196,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:54 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:54 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -256,9 +206,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - s8aX5NtChXwcC0ZqCGPgUtbvI/yT4gadlVvE6/Mqbm4BIdrCBC60TudMJNU/SbvE + - LcgNasIYBRkNppmD6mCKE9J6iv0eEjosuuHR5V5zw2fWbR54i39C8dhdK8zDq/40 X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -266,7 +216,7 @@ interactions: duration: "" - request: body: | - {"client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","host_filters":"","project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768"} + {"automute":false,"client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","host_filters":"","project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454"} form: {} headers: Accept: @@ -276,14 +226,7 @@ interactions: Dd-Operation-Id: - UpdateGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "8760757891920668468" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: PUT response: @@ -300,20 +243,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:55 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:55 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - H6YNJZe2hxg7AD4MytxnK6WTGV3v238t6qy6wX4rqFlv+Cb0Gp+GU8J41gMZvmVb + - l8RQo2maZqJf6GFThBbKNE6dvthz6njusVtau3dPXJWL2RLFoN81H+BLPB/1xgs1 X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -328,18 +268,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "7618007047577059088" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' headers: Cache-Control: - no-cache @@ -350,12 +283,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:56 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:55 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -363,9 +293,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - /0aUVUH/0B08LSgkH1j961ejfqRhimJkYAixzpnRf5lscmOFHWjl/leOQ3Mnfn7R + - l4HFlaRP3QwYSqoGKhzbYfv7zgkK63HIRR7YkyVYZspq0lGjjTBwoK8V/alf+XYt X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -380,18 +310,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "3624345255100010357" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' headers: Cache-Control: - no-cache @@ -402,12 +325,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:56 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:56 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -415,9 +335,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - WyPl7Uohyy2nhJ7RWrq85UM5TEMaIEIfRwQveR0xpNBygzZEP8S/qWubDM7SoNjW + - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -432,18 +352,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "7058472798031094113" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' headers: Cache-Control: - no-cache @@ -454,12 +367,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:57 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:57 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -467,9 +377,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - n9uz1T+WujhmfsGndIdy1tCYb5bh9AzSyYOT5TTjJX23RGEavHxGqcz400IC+bY1 + - dPySkcOzIZtKyMKDAAzuysY3gNGGj6RtYogGuSb76E8mPvoqzREyRp6lPYm91hQU X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -484,18 +394,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "5886971480828274173" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768","client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' headers: Cache-Control: - no-cache @@ -506,12 +409,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:58 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:58 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -519,9 +419,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - s8aX5NtChXwcC0ZqCGPgUtbvI/yT4gadlVvE6/Mqbm4BIdrCBC60TudMJNU/SbvE + - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -529,7 +429,7 @@ interactions: duration: "" - request: body: | - {"client_email":"tf-TestAccDatadogIntegrationGCP-local-1609425768@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogIntegrationGCP-local-1609425768"} + {"client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454"} form: {} headers: Accept: @@ -539,14 +439,7 @@ interactions: Dd-Operation-Id: - DeleteGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "4881534741366367614" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: DELETE response: @@ -563,20 +456,146 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:58 GMT + - Tue, 30 Mar 2021 17:30:56 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:58 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - ks6TYG2WFSBr2qT+ZTFJB8BB7VWuwPmODDq52A4JjLzCAAitR8HQc9JBq+LHjJu4 + - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU X-Dd-Version: - - "35.3622023" + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","automute":true,"client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","host_filters":"","private_key":"-----BEGIN PRIVATE KEY-----\n key updated \n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - CreateGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: POST + response: + body: '{}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:57 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk + X-Dd-Version: + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: GET + response: + body: '[{"automute":true,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:57 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - 5gfwVh/5HZ+AnGd/Di93w3NEWC6KMHT9KzmHEiRJmNdOjBtAsbOcgVFyqEChw71h + X-Dd-Version: + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: GET + response: + body: '[{"automute":true,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:57 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - gYZcaADwbKcv7Hm19HJx6WsLoKuOijDWAt2viPeCfWqUgyKY+9e1xZdmMJeXV3YV + X-Dd-Version: + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -591,18 +610,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.15.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.13+dev (go go1.15.4; os darwin; arch amd64) - X-Datadog-Parent-Id: - - "7314957122680688084" - X-Datadog-Sampling-Priority: - - "1" - X-Datadog-Trace-Id: - - "5787989901893314156" + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":true,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' headers: Cache-Control: - no-cache @@ -613,12 +625,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 31 Dec 2020 14:42:59 GMT + - Tue, 30 Mar 2021 17:30:57 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 07-Jan-2021 14:42:58 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -626,9 +635,138 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - 4UaTmvSfVgrAnk9WjtnugRwYwQHzmV7Xe8CPpF1D3zUjc+biqLvKLM8GlhPhoOpi + - B1nwy/pPNqX+q4pQT22cdp1QCexE35IF8qwSHy0Nf7IW0Y881qtn4tXN1lpmzaKc + X-Dd-Version: + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: GET + response: + body: '[{"automute":true,"project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454","client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":""}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:57 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - 25u1gDlL724DHllbjFT4BhOLorBTilh+aah2uWAUEjFC/+rjczJdiyWrV/HwLwe/ + X-Dd-Version: + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"client_email":"tf-TestAccDatadogIntegrationGCP-local-1617125454@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogIntegrationGCP-local-1617125454"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - DeleteGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: DELETE + response: + body: '{}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:57 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - l4HFlaRP3QwYSqoGKhzbYfv7zgkK63HIRR7YkyVYZspq0lGjjTBwoK8V/alf+XYt + X-Dd-Version: + - "35.4202512" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListGCPIntegration + User-Agent: + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/integration/gcp + method: GET + response: + body: '[]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Tue, 30 Mar 2021 17:30:58 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU X-Dd-Version: - - "35.3622023" + - "35.4202512" X-Frame-Options: - SAMEORIGIN status: 200 OK diff --git a/datadog/tests/resource_datadog_integration_gcp_test.go b/datadog/tests/resource_datadog_integration_gcp_test.go index b47fc6a362..2d72b3d042 100644 --- a/datadog/tests/resource_datadog_integration_gcp_test.go +++ b/datadog/tests/resource_datadog_integration_gcp_test.go @@ -35,6 +35,18 @@ resource "datadog_integration_gcp" "awesome_gcp_project_integration" { }`, uniq, uniq) } +func testAccCheckDatadogIntegrationGCPUpdatePrivateKeyConfig(uniq string) string { + return fmt.Sprintf(` +resource "datadog_integration_gcp" "awesome_gcp_project_integration" { + project_id = "%s" + private_key_id = "1234567890123456789012345678901234567890" + private_key = "-----BEGIN PRIVATE KEY-----\n key updated \n-----END PRIVATE KEY-----\n" + client_email = "%s@awesome-project-id.iam.gserviceaccount.com" + client_id = "123456789012345678901" + automute = true +}`, uniq, uniq) +} + func TestAccDatadogIntegrationGCP(t *testing.T) { ctx, accProviders := testAccProviders(context.Background(), t) client := uniqueEntityName(ctx, t) @@ -67,6 +79,9 @@ func TestAccDatadogIntegrationGCP(t *testing.T) { resource.TestCheckResourceAttr( "datadog_integration_gcp.awesome_gcp_project_integration", "host_filters", "foo:bar,buzz:lightyear"), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "automute", "false"), ), }, { @@ -91,6 +106,36 @@ func TestAccDatadogIntegrationGCP(t *testing.T) { resource.TestCheckResourceAttr( "datadog_integration_gcp.awesome_gcp_project_integration", "host_filters", ""), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "automute", "false"), + ), + }, + { + Config: testAccCheckDatadogIntegrationGCPUpdatePrivateKeyConfig(client), + Check: resource.ComposeTestCheckFunc( + checkIntegrationGCPExists(accProvider), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "project_id", client), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "private_key_id", "1234567890123456789012345678901234567890"), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "private_key", "-----BEGIN PRIVATE KEY-----\n key updated \n-----END PRIVATE KEY-----\n"), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "client_email", fmt.Sprintf("%s@awesome-project-id.iam.gserviceaccount.com", client)), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "client_id", "123456789012345678901"), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "host_filters", ""), + resource.TestCheckResourceAttr( + "datadog_integration_gcp.awesome_gcp_project_integration", + "automute", "true"), ), }, }, diff --git a/docs/resources/integration_gcp.md b/docs/resources/integration_gcp.md index 7c9adf7fc2..c56902f789 100644 --- a/docs/resources/integration_gcp.md +++ b/docs/resources/integration_gcp.md @@ -37,6 +37,7 @@ resource "datadog_integration_gcp" "awesome_gcp_project_integration" { ### Optional +- **automute** (Boolean) Silence monitors for expected GCE instance shutdowns. - **host_filters** (String) Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog. - **id** (String) The ID of this resource. From cd8ede05e00e8cfdd7251b51b8a5ea674895d429 Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Tue, 30 Mar 2021 13:41:10 -0400 Subject: [PATCH 2/4] lint --- datadog/resource_datadog_integration_gcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/resource_datadog_integration_gcp.go b/datadog/resource_datadog_integration_gcp.go index 4c371d0d5e..60a6cdd6c2 100644 --- a/datadog/resource_datadog_integration_gcp.go +++ b/datadog/resource_datadog_integration_gcp.go @@ -82,7 +82,6 @@ func resourceDatadogIntegrationGcpCreate(d *schema.ResourceData, meta interface{ if _, _, err := datadogClientV1.GCPIntegrationApi.CreateGCPIntegration(authV1).Body( datadogV1.GCPAccount{ Type: datadogV1.PtrString(defaultType), - Automute: datadogV1.PtrBool(d.Get("automute").(bool)), ProjectId: datadogV1.PtrString(projectID), PrivateKeyId: datadogV1.PtrString(d.Get("private_key_id").(string)), PrivateKey: datadogV1.PtrString(d.Get("private_key").(string)), @@ -93,6 +92,7 @@ func resourceDatadogIntegrationGcpCreate(d *schema.ResourceData, meta interface{ AuthProviderX509CertUrl: datadogV1.PtrString(defaultAuthProviderX509CertURL), ClientX509CertUrl: datadogV1.PtrString(defaultClientX509CertURLPrefix + d.Get("client_email").(string)), HostFilters: datadogV1.PtrString(d.Get("host_filters").(string)), + Automute: datadogV1.PtrBool(d.Get("automute").(bool)), }, ).Execute(); err != nil { return utils.TranslateClientError(err, "error creating GCP integration") From 6f0fa9805f189c98331603b9141462a65b51cd4e Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Tue, 30 Mar 2021 13:49:01 -0400 Subject: [PATCH 3/4] re-record cassettes --- .../TestAccDatadogLogsArchiveGCS_basic.freeze | 2 +- .../TestAccDatadogLogsArchiveGCS_basic.yaml | 182 +++++++---------- ...tadogLogsArchiveGCS_basicDeprecated.freeze | 2 +- ...DatadogLogsArchiveGCS_basicDeprecated.yaml | 184 +++++++----------- 4 files changed, 141 insertions(+), 229 deletions(-) diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.freeze b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.freeze index 3ad3f92201..8407adc3e6 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.freeze +++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.freeze @@ -1 +1 @@ -2021-02-11T11:22:51.33621+01:00 \ No newline at end of file +2021-03-30T13:48:22.326086-04:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.yaml b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.yaml index 9f2700fdda..5d2160d62a 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.yaml +++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basic.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","automute":false,"client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} form: {} headers: Accept: @@ -13,8 +13,7 @@ interactions: Dd-Operation-Id: - CreateGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: POST response: @@ -31,20 +30,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:51 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:51 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - /L+SFFO+m1pPY+hRCpk5325fvfrNl0KmiquUNJolBN/5hu3HIwflqjZSbJ6NxDFG + - LcgNasIYBRkNppmD6mCKE9J6iv0eEjosuuHR5V5zw2fWbR54i39C8dhdK8zDq/40 X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -59,12 +55,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -75,12 +70,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:52 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:52 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -88,9 +80,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - 2328yjLSqI4XmR1pVqrPRR/SFcQsbafjEpPmZx7/3PfxUK1nJQQsX+wrMelyVyj+ + - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -98,7 +90,7 @@ interactions: duration: "" - request: body: | - {"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971"},"path":"/path/blah","type":"gcs"},"include_tags":false,"name":"my first gcs archive","query":"service:tata","rehydration_tags":[]},"type":"archives"}} + {"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502"},"path":"/path/blah","type":"gcs"},"include_tags":false,"name":"my first gcs archive","query":"service:tata","rehydration_tags":[]},"type":"archives"}} form: {} headers: Accept: @@ -108,13 +100,11 @@ interactions: Dd-Operation-Id: - CreateLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v2/logs/config/archives method: POST response: - body: '{"data":{"type":"archives","id":"DokcfGd2RTS4AGlxsFPKiQ","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"rU9XBBP_QLyqspaF3Y2EwQ","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -125,12 +115,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:52 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:52 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -138,9 +125,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q + - Um4CoU685QqAscnxhS5BD+goWu2yX1Jd4zCfGzSsEvPPIm1qURZaF8dlLl/OEY4I X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -148,9 +135,9 @@ interactions: X-Ratelimit-Period: - "300" X-Ratelimit-Remaining: - - "288" + - "297" X-Ratelimit-Reset: - - "128" + - "97" status: 200 OK code: 200 duration: "" @@ -163,12 +150,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -179,12 +165,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:53 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:52 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -192,9 +175,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - B1nwy/pPNqX+q4pQT22cdp1QCexE35IF8qwSHy0Nf7IW0Y881qtn4tXN1lpmzaKc + - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -209,13 +192,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/DokcfGd2RTS4AGlxsFPKiQ + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/rU9XBBP_QLyqspaF3Y2EwQ method: GET response: - body: '{"data":{"type":"archives","id":"DokcfGd2RTS4AGlxsFPKiQ","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"rU9XBBP_QLyqspaF3Y2EwQ","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -226,12 +207,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:53 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:53 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -239,9 +217,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - S1wfaMZOKGT/IoMw6fqAwAwGWo2vQ44sjF3YzuETnQfxZO2T5eJbs0aX3UKb9Dwu + - tpRCH6w417YjBovRJ8VmtuXmNONVYiRp2c8d2AxjPdGBn8PCtgG4vAztrx3qUZAN X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -249,9 +227,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4967" + - "4996" X-Ratelimit-Reset: - - "2227" + - "697" status: 200 OK code: 200 duration: "" @@ -264,12 +242,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -280,12 +257,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:53 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:53 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -293,9 +267,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - LcgNasIYBRkNppmD6mCKE9J6iv0eEjosuuHR5V5zw2fWbR54i39C8dhdK8zDq/40 + - gYZcaADwbKcv7Hm19HJx6WsLoKuOijDWAt2viPeCfWqUgyKY+9e1xZdmMJeXV3YV X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -310,13 +284,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/DokcfGd2RTS4AGlxsFPKiQ + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/rU9XBBP_QLyqspaF3Y2EwQ method: GET response: - body: '{"data":{"type":"archives","id":"DokcfGd2RTS4AGlxsFPKiQ","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"rU9XBBP_QLyqspaF3Y2EwQ","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -327,12 +299,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:53 GMT + - Tue, 30 Mar 2021 17:48:23 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:53 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -340,9 +309,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - twvpGlmuom5y6A0pjGtXzTf554cmwJgTcCZ71fK4H/RDi+v5ehBK0zQiRcTJQG5C + - gYZcaADwbKcv7Hm19HJx6WsLoKuOijDWAt2viPeCfWqUgyKY+9e1xZdmMJeXV3YV X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -350,9 +319,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4966" + - "4995" X-Ratelimit-Reset: - - "2227" + - "697" status: 200 OK code: 200 duration: "" @@ -365,9 +334,8 @@ interactions: Dd-Operation-Id: - DeleteLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/DokcfGd2RTS4AGlxsFPKiQ + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/rU9XBBP_QLyqspaF3Y2EwQ method: DELETE response: body: "" @@ -383,20 +351,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:54 GMT + - Tue, 30 Mar 2021 17:48:24 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:54 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - gYZcaADwbKcv7Hm19HJx6WsLoKuOijDWAt2viPeCfWqUgyKY+9e1xZdmMJeXV3YV + - fIO2C4qGDheGHy4YbS+r3a3CXbh4cbRo7roILOimQyiHGjQdOat0cIpWCkupM1uX X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -404,15 +369,15 @@ interactions: X-Ratelimit-Period: - "300" X-Ratelimit-Remaining: - - "287" + - "296" X-Ratelimit-Reset: - - "126" + - "97" status: 204 No Content code: 204 duration: "" - request: body: | - {"client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1613038971"} + {"client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-local-1617126502"} form: {} headers: Accept: @@ -422,8 +387,7 @@ interactions: Dd-Operation-Id: - DeleteGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: DELETE response: @@ -440,12 +404,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:54 GMT + - Tue, 30 Mar 2021 17:48:24 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:54 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: @@ -453,7 +414,7 @@ interactions: X-Dd-Debug: - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -468,12 +429,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/DokcfGd2RTS4AGlxsFPKiQ + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/rU9XBBP_QLyqspaF3Y2EwQ method: GET response: - body: '{"errors": ["Archive DokcfGd2RTS4AGlxsFPKiQ not found"]}' + body: '{"errors": ["Archive rU9XBBP_QLyqspaF3Y2EwQ not found"]}' headers: Cache-Control: - no-cache @@ -484,7 +444,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:54 GMT + - Tue, 30 Mar 2021 17:48:24 GMT Pragma: - no-cache Strict-Transport-Security: @@ -494,7 +454,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -502,9 +462,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4965" + - "4994" X-Ratelimit-Reset: - - "2226" + - "696" status: 404 Not Found code: 404 duration: "" @@ -517,38 +477,34 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[]' headers: Cache-Control: - no-cache Connection: - keep-alive + Content-Length: + - "2" Content-Security-Policy: - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:54 GMT + - Tue, 30 Mar 2021 17:48:24 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:54 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; - Vary: - - Accept-Encoding X-Content-Type-Options: - nosniff X-Dd-Debug: - - dPySkcOzIZtKyMKDAAzuysY3gNGGj6RtYogGuSb76E8mPvoqzREyRp6lPYm91hQU + - 2328yjLSqI4XmR1pVqrPRR/SFcQsbafjEpPmZx7/3PfxUK1nJQQsX+wrMelyVyj+ X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.freeze b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.freeze index e3dd167d57..d2c5db607d 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.freeze +++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.freeze @@ -1 +1 @@ -2021-02-11T11:22:47.402226+01:00 \ No newline at end of file +2021-03-30T13:48:19.618471-04:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.yaml b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.yaml index 0a73b31ad4..ba8b599216 100644 --- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.yaml +++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveGCS_basicDeprecated.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","automute":false,"client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","client_id":"123456789012345678901","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","host_filters":"foo:bar,buzz:lightyear","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","private_key_id":"1234567890123456789012345678901234567890","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} form: {} headers: Accept: @@ -13,8 +13,7 @@ interactions: Dd-Operation-Id: - CreateGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: POST response: @@ -31,20 +30,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:47 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:47 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - dPySkcOzIZtKyMKDAAzuysY3gNGGj6RtYogGuSb76E8mPvoqzREyRp6lPYm91hQU + - HbtaOKlJ6OCrx9tMXO6ivMTrEM+g0c93HDp08trmOmgdHozC5J+vn10F0H4WPjCU X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -59,12 +55,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -75,12 +70,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:48 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:48 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -88,9 +80,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - Um4CoU685QqAscnxhS5BD+goWu2yX1Jd4zCfGzSsEvPPIm1qURZaF8dlLl/OEY4I + - fIO2C4qGDheGHy4YbS+r3a3CXbh4cbRo7roILOimQyiHGjQdOat0cIpWCkupM1uX X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -98,7 +90,7 @@ interactions: duration: "" - request: body: | - {"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967"},"path":"/path/blah","type":"gcs"},"include_tags":false,"name":"my first gcs archive","query":"service:tata","rehydration_tags":[]},"type":"archives"}} + {"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499"},"path":"/path/blah","type":"gcs"},"include_tags":false,"name":"my first gcs archive","query":"service:tata","rehydration_tags":[]},"type":"archives"}} form: {} headers: Accept: @@ -108,13 +100,11 @@ interactions: Dd-Operation-Id: - CreateLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v2/logs/config/archives method: POST response: - body: '{"data":{"type":"archives","id":"zLnBjkbhT0uxMnnsjwkROw","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"qBscKILET-akCCGFyi8oZw","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -125,12 +115,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:48 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:48 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -138,9 +125,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - S1wfaMZOKGT/IoMw6fqAwAwGWo2vQ44sjF3YzuETnQfxZO2T5eJbs0aX3UKb9Dwu + - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -148,9 +135,9 @@ interactions: X-Ratelimit-Period: - "300" X-Ratelimit-Remaining: - - "290" + - "299" X-Ratelimit-Reset: - - "132" + - "99" status: 200 OK code: 200 duration: "" @@ -163,12 +150,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -179,12 +165,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:49 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:48 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -192,9 +175,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - dCmL/3rURV6BPeaqeP3Rxigq41m5CAb17XjrRE42uZ01zpr07HVhbL5/3TWMkvgu + - l8RQo2maZqJf6GFThBbKNE6dvthz6njusVtau3dPXJWL2RLFoN81H+BLPB/1xgs1 X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -209,13 +192,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/zLnBjkbhT0uxMnnsjwkROw + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/qBscKILET-akCCGFyi8oZw method: GET response: - body: '{"data":{"type":"archives","id":"zLnBjkbhT0uxMnnsjwkROw","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"qBscKILET-akCCGFyi8oZw","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -226,12 +207,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:49 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:49 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -239,9 +217,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - 5gfwVh/5HZ+AnGd/Di93w3NEWC6KMHT9KzmHEiRJmNdOjBtAsbOcgVFyqEChw71h + - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -249,9 +227,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4970" + - "4999" X-Ratelimit-Reset: - - "2231" + - "699" status: 200 OK code: 200 duration: "" @@ -264,12 +242,11 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' headers: Cache-Control: - no-cache @@ -280,12 +257,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:49 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:49 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -293,9 +267,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - l4HFlaRP3QwYSqoGKhzbYfv7zgkK63HIRR7YkyVYZspq0lGjjTBwoK8V/alf+XYt + - fIO2C4qGDheGHy4YbS+r3a3CXbh4cbRo7roILOimQyiHGjQdOat0cIpWCkupM1uX X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -310,13 +284,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/zLnBjkbhT0uxMnnsjwkROw + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/qBscKILET-akCCGFyi8oZw method: GET response: - body: '{"data":{"type":"archives","id":"zLnBjkbhT0uxMnnsjwkROw","attributes":{"name":"my - first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' + body: '{"data":{"type":"archives","id":"qBscKILET-akCCGFyi8oZw","attributes":{"name":"my first gcs archive","query":"service:tata","state":"UNKNOWN","destination":{"bucket":"dd-logs-test-datadog-api-client-go","path":"/path/blah","type":"gcs","integration":{"project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499","client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com"}},"rehydration_tags":[],"include_tags":false}}}' headers: Cache-Control: - no-cache @@ -327,12 +299,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:50 GMT + - Tue, 30 Mar 2021 17:48:21 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:50 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; Vary: @@ -340,9 +309,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - S1wfaMZOKGT/IoMw6fqAwAwGWo2vQ44sjF3YzuETnQfxZO2T5eJbs0aX3UKb9Dwu + - l8RQo2maZqJf6GFThBbKNE6dvthz6njusVtau3dPXJWL2RLFoN81H+BLPB/1xgs1 X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -350,9 +319,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4969" + - "4998" X-Ratelimit-Reset: - - "2230" + - "699" status: 200 OK code: 200 duration: "" @@ -365,9 +334,8 @@ interactions: Dd-Operation-Id: - DeleteLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/zLnBjkbhT0uxMnnsjwkROw + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/qBscKILET-akCCGFyi8oZw method: DELETE response: body: "" @@ -383,20 +351,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:50 GMT + - Tue, 30 Mar 2021 17:48:22 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:50 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - B1nwy/pPNqX+q4pQT22cdp1QCexE35IF8qwSHy0Nf7IW0Y881qtn4tXN1lpmzaKc + - bgHykj7A9bfZx0Y5ZO3swhhp5tGUSNJHqFWR868+qg087CYrDOd5hQslC+noiEtH X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -404,15 +369,15 @@ interactions: X-Ratelimit-Period: - "300" X-Ratelimit-Remaining: - - "289" + - "298" X-Ratelimit-Reset: - - "130" + - "98" status: 204 No Content code: 204 duration: "" - request: body: | - {"client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1613038967"} + {"client_email":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499@awesome-project-id.iam.gserviceaccount.com","project_id":"tf-TestAccDatadogLogsArchiveGCS_basicDeprecated-local-1617126499"} form: {} headers: Accept: @@ -422,8 +387,7 @@ interactions: Dd-Operation-Id: - DeleteGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: DELETE response: @@ -440,20 +404,17 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:50 GMT + - Tue, 30 Mar 2021 17:48:22 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:50 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - 2328yjLSqI4XmR1pVqrPRR/SFcQsbafjEpPmZx7/3PfxUK1nJQQsX+wrMelyVyj+ + - 5gfwVh/5HZ+AnGd/Di93w3NEWC6KMHT9KzmHEiRJmNdOjBtAsbOcgVFyqEChw71h X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK @@ -468,12 +429,11 @@ interactions: Dd-Operation-Id: - GetLogsArchive User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v2/logs/config/archives/zLnBjkbhT0uxMnnsjwkROw + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v2/logs/config/archives/qBscKILET-akCCGFyi8oZw method: GET response: - body: '{"errors": ["Archive zLnBjkbhT0uxMnnsjwkROw not found"]}' + body: '{"errors": ["Archive qBscKILET-akCCGFyi8oZw not found"]}' headers: Cache-Control: - no-cache @@ -484,7 +444,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:50 GMT + - Tue, 30 Mar 2021 17:48:22 GMT Pragma: - no-cache Strict-Transport-Security: @@ -494,7 +454,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -502,9 +462,9 @@ interactions: X-Ratelimit-Period: - "3600" X-Ratelimit-Remaining: - - "4968" + - "4997" X-Ratelimit-Reset: - - "2230" + - "698" status: 404 Not Found code: 404 duration: "" @@ -517,38 +477,34 @@ interactions: Dd-Operation-Id: - ListGCPIntegration User-Agent: - - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) - datadog-api-client-go/1.0.0-beta.15 (go go1.15.7; os darwin; arch amd64) + - terraform-provider-datadog/dev (terraform 1.16.0; terraform-cli 0.12.7-sdk) datadog-api-client-go/1.0.0-beta.19+dev (go go1.15.3; os darwin; arch amd64) url: https://api.datadoghq.com/api/v1/integration/gcp method: GET response: - body: '[{"automute":false,"project_id":"go-TestGCPCreate-25132-1600970650","client_email":"go-TestGCPCreate-25132-1600970650@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"go-TestGCPCreate-42757-1611662666","client_email":"go-TestGCPCreate-42757-1611662666@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39829-1610312816","client_email":"go-TestUpdateGCPAccount-39829-1610312816@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":true,"project_id":"go-TestUpdateGCPAccount-39939-1610374022","client_email":"go-TestUpdateGCPAccount-39939-1610374022@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:update,example:update"},{"automute":false,"project_id":"go-TestUpdateGCPAccount-42119-1611302336","client_email":"go-TestUpdateGCPAccount-42119-1611302336@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-createGCPIntegrationTest-39170-1609803430","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"java-updateGCPIntegrationTest-39170-1609803445","client_email":"api-test@fake-sandbox.iam.gserviceaccount.com","errors":[],"host_filters":"fake:tag,example:test"},{"automute":false,"project_id":"super-awesome-project-id","client_email":"awesome-service-account@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42579-1611592767","client_email":"tf-TestAccDatadogIntegrationGCP-42579-1611592767@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogIntegrationGCP-42676-1611655233","client_email":"tf-TestAccDatadogIntegrationGCP-42676-1611655233@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-41426-1611053108@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"},{"automute":false,"project_id":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519","client_email":"tf-TestAccDatadogLogsArchiveGCS_basic-44299-1612287519@awesome-project-id.iam.gserviceaccount.com","errors":[],"host_filters":"foo:bar,buzz:lightyear"}]' + body: '[]' headers: Cache-Control: - no-cache Connection: - keep-alive + Content-Length: + - "2" Content-Security-Policy: - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Thu, 11 Feb 2021 10:22:51 GMT + - Tue, 30 Mar 2021 17:48:22 GMT Pragma: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 10:22:50 GMT; - secure; HttpOnly Strict-Transport-Security: - max-age=15724800; - Vary: - - Accept-Encoding X-Content-Type-Options: - nosniff X-Dd-Debug: - - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk + - Wjq53IVIwnB4SiR238oOYgHFMq/ZYP0LQ/Dv8C2fFLBwTje/dWJHu6pI6vIOK1zG X-Dd-Version: - - "35.3888616" + - "35.4202526" X-Frame-Options: - SAMEORIGIN status: 200 OK From 4321a56c86e3763a53174ebb46edbe01aabf8a28 Mon Sep 17 00:00:00 2001 From: Sherzod K Date: Wed, 31 Mar 2021 09:21:16 -0400 Subject: [PATCH 4/4] Set ForceNew to true for client_email as well --- datadog/resource_datadog_integration_gcp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/datadog/resource_datadog_integration_gcp.go b/datadog/resource_datadog_integration_gcp.go index 60a6cdd6c2..69e8edab85 100644 --- a/datadog/resource_datadog_integration_gcp.go +++ b/datadog/resource_datadog_integration_gcp.go @@ -42,6 +42,7 @@ func resourceDatadogIntegrationGcp() *schema.Resource { Description: "Your email found in your JSON service account key.", Type: schema.TypeString, Required: true, + ForceNew: true, }, "client_id": { Description: "Your ID found in your JSON service account key.",