From da54d2ae6b55991fe28b043412ebe4c37521f726 Mon Sep 17 00:00:00 2001 From: Alexandre Pocquet Date: Wed, 19 Jun 2024 09:52:40 +0200 Subject: [PATCH 1/3] Upgrade datadog-api-client-go to v2.26.1-0.20240618193852-3e8041dde616 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ffec3d4045..31d095f01a 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-datadog require ( - github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240614210232-cc3cd19ea44f + github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240618193852-3e8041dde616 github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad github.com/google/uuid v1.5.0 github.com/hashicorp/go-cleanhttp v0.5.2 diff --git a/go.sum b/go.sum index 63e743aac6..9de8c5b05c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240614210232-cc3cd19ea44f h1:GClzSWYeKzzzqyWHGKW5qYcXfdVSyq4K/YKNyDJe4F0= -github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240614210232-cc3cd19ea44f/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= +github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240618193852-3e8041dde616 h1:OhCEkIMEn+oseqT63gwslk110qUIYvIp46fmgYa0wK4= +github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240618193852-3e8041dde616/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= From 1ec3fe3670d22b76884c3345818a0a160fb07bee Mon Sep 17 00:00:00 2001 From: Alexandre Pocquet Date: Tue, 30 Apr 2024 10:29:29 +0200 Subject: [PATCH 2/3] Fix resource_datadog_organization_settings_test.go test naming --- ...e => TestAccDatadogOrganizationSettings_Import.freeze} | 0 ...aml => TestAccDatadogOrganizationSettings_Import.yaml} | 8 ++++---- .../tests/resource_datadog_organization_settings_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename datadog/tests/cassettes/{TestDatadogOrganizationSettings_import.freeze => TestAccDatadogOrganizationSettings_Import.freeze} (100%) rename datadog/tests/cassettes/{TestDatadogOrganizationSettings_import.yaml => TestAccDatadogOrganizationSettings_Import.yaml} (94%) diff --git a/datadog/tests/cassettes/TestDatadogOrganizationSettings_import.freeze b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze similarity index 100% rename from datadog/tests/cassettes/TestDatadogOrganizationSettings_import.freeze rename to datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze diff --git a/datadog/tests/cassettes/TestDatadogOrganizationSettings_import.yaml b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml similarity index 94% rename from datadog/tests/cassettes/TestDatadogOrganizationSettings_import.yaml rename to datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml index 04e259d0b3..70e1ae6b9d 100644 --- a/datadog/tests/cassettes/TestDatadogOrganizationSettings_import.yaml +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml @@ -19,7 +19,7 @@ interactions: duration: "0ms" - request: body: | - {"name":"ttings_import-local-1628254708"} + {"name":"ttings_Import-local-1628254708"} form: {} headers: Accept: @@ -30,7 +30,7 @@ interactions: method: PUT id: 1 response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' + body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' headers: Content-Type: - application/json @@ -47,7 +47,7 @@ interactions: method: GET id: 2 response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' + body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' headers: Content-Type: - application/json @@ -64,7 +64,7 @@ interactions: method: GET id: 3 response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' + body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' headers: Content-Type: - application/json diff --git a/datadog/tests/resource_datadog_organization_settings_test.go b/datadog/tests/resource_datadog_organization_settings_test.go index 82f51d2761..8a172e0897 100644 --- a/datadog/tests/resource_datadog_organization_settings_test.go +++ b/datadog/tests/resource_datadog_organization_settings_test.go @@ -128,7 +128,7 @@ func TestAccDatadogOrganizationSettings_Update(t *testing.T) { }) } -func TestDatadogOrganizationSettings_import(t *testing.T) { +func TestAccDatadogOrganizationSettings_Import(t *testing.T) { if !isReplaying() { t.Skip("This test only supports replaying") } From 73662b2e283a6f7a05d445f4ef609cb11c2a27e5 Mon Sep 17 00:00:00 2001 From: Alexandre Pocquet Date: Mon, 6 May 2024 16:37:12 +0200 Subject: [PATCH 3/3] Add Security Contacts support in datadog_organization_settings --- .github/CODEOWNERS | 1 + datadog/internal/utils/utils.go | 10 + datadog/internal/validators/validators.go | 23 + .../resource_datadog_child_organization.go | 14 +- .../resource_datadog_organization_settings.go | 129 +- ...cDatadogOrganizationSettings_Import.freeze | 2 +- ...AccDatadogOrganizationSettings_Import.yaml | 320 +++- ...gOrganizationSettings_IncorrectName.freeze | 2 +- ...dogOrganizationSettings_IncorrectName.yaml | 1 + ...ganizationSettings_SecurityContacts.freeze | 1 + ...OrganizationSettings_SecurityContacts.yaml | 1599 +++++++++++++++++ ...cDatadogOrganizationSettings_Update.freeze | 2 +- ...AccDatadogOrganizationSettings_Update.yaml | 871 +++++++-- ...urce_datadog_organization_settings_test.go | 117 +- docs/resources/organization_settings.md | 1 + go.mod | 2 +- 16 files changed, 2788 insertions(+), 307 deletions(-) create mode 100644 datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.freeze create mode 100644 datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1455c9c8db..ba9bb20d5e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -43,3 +43,4 @@ datadog/**/*datadog_service_account* @DataDog/api-clients @DataDog/te datadog/**/*datadog_spans_metric* @DataDog/api-clients @DataDog/apm-trace-intake datadog/**/*datadog_synthetics_concurrency_cap* @DataDog/api-clients @DataDog/synthetics-app @DataDog/synthetics-ct datadog/**/*datadog_team* @DataDog/api-clients @DataDog/core-app +datadog/**/*datadog_organization_settings* @DataDog/api-clients @DataDog/core-app @DataDog/trust-and-safety diff --git a/datadog/internal/utils/utils.go b/datadog/internal/utils/utils.go index 65cf52e054..7d96e2afa3 100644 --- a/datadog/internal/utils/utils.go +++ b/datadog/internal/utils/utils.go @@ -394,3 +394,13 @@ func NormMetricNameParse(name string) string { return string(res) } + +// AnyToSlice casts a raw interface{} to a well-typed slice (useful for reading Terraform ResourceData) +func AnyToSlice[T any](raw any) []T { + rawSlice := raw.([]interface{}) + result := make([]T, len(rawSlice)) + for i, x := range rawSlice { + result[i] = x.(T) + } + return result +} diff --git a/datadog/internal/validators/validators.go b/datadog/internal/validators/validators.go index 75211bef2d..e296bed06c 100644 --- a/datadog/internal/validators/validators.go +++ b/datadog/internal/validators/validators.go @@ -232,6 +232,29 @@ func ValidateAWSAccountID(v any, p cty.Path) diag.Diagnostics { return diags } +var _ schema.SchemaValidateDiagFunc = ValidateBasicEmail +var basicEmailRe = regexp.MustCompile("^[^@]+@[^@]+\\.[^@.]+$") + +// ValidateBasicEmail ensures a string looks like an email +func ValidateBasicEmail(val any, path cty.Path) diag.Diagnostics { + str, ok := val.(string) + if !ok { + return diag.Diagnostics{{ + Severity: diag.Error, + Summary: fmt.Sprintf("not a string: %s", val), + AttributePath: path, + }} + } + if !basicEmailRe.MatchString(str) { + return diag.Diagnostics{{ + Severity: diag.Error, + Summary: fmt.Sprintf("not a email: %s", str), + AttributePath: path, + }} + } + return nil +} + type BetweenValidator struct { min float64 max float64 diff --git a/datadog/resource_datadog_child_organization.go b/datadog/resource_datadog_child_organization.go index d24aae4cc5..637b302b61 100644 --- a/datadog/resource_datadog_child_organization.go +++ b/datadog/resource_datadog_child_organization.go @@ -224,6 +224,7 @@ func buildDatadogOrganizationCreateV1Struct(d *schema.ResourceData) *datadogV1.O } func updateOrganizationState(d *schema.ResourceData, org *datadogV1.Organization) diag.Diagnostics { + d.SetId(org.GetPublicId()) d.Set("name", org.GetName()) d.Set("public_id", org.GetPublicId()) d.Set("description", org.GetDescription()) @@ -333,14 +334,11 @@ func resourceDatadogChildOrganizationCreate(ctx context.Context, d *schema.Resou applicationKey := resp.GetApplicationKey() user := resp.GetUser() - publicId := org.GetPublicId() - d.SetId(publicId) - - updateOrganizationApiKeyState(d, &apiKey) - updateOrganizationApplicationKeyState(d, &applicationKey) - updateOrganizationUserState(d, &user) - - return updateOrganizationState(d, &org) + diags := updateOrganizationState(d, &org) + diags = append(diags, updateOrganizationApiKeyState(d, &apiKey)...) + diags = append(diags, updateOrganizationApplicationKeyState(d, &applicationKey)...) + diags = append(diags, updateOrganizationUserState(d, &user)...) + return diags } func resourceDatadogChildOrganizationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { diff --git a/datadog/resource_datadog_organization_settings.go b/datadog/resource_datadog_organization_settings.go index 2e3188f183..5a5a08f220 100644 --- a/datadog/resource_datadog_organization_settings.go +++ b/datadog/resource_datadog_organization_settings.go @@ -2,13 +2,21 @@ package datadog import ( "context" - - "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" + "fmt" + "time" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/go-cmp/cmp" + "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/go-cty/cty/gocty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/validators" ) func resourceDatadogOrganizationSettings() *schema.Resource { @@ -40,6 +48,17 @@ func resourceDatadogOrganizationSettings() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "security_contacts": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "List of emails used for security event notifications from the organization.", + Elem: &schema.Schema{ + Type: schema.TypeString, + Description: "An email address to be used for security event notifications.", + ValidateDiagFunc: validators.ValidateBasicEmail, + }, + }, "settings": { Description: "Organization settings", Type: schema.TypeList, @@ -51,7 +70,7 @@ func resourceDatadogOrganizationSettings() *schema.Resource { "private_widget_share": { Type: schema.TypeBool, Optional: true, - Default: false, + Default: false, // FIXME: leave it "unspecified" by default like the child org schema ? Description: "Whether or not the organization users can share widgets outside of Datadog.", }, "saml": { @@ -73,7 +92,7 @@ func resourceDatadogOrganizationSettings() *schema.Resource { "saml_autocreate_access_role": { Type: schema.TypeString, Optional: true, - Default: "st", + Default: "st", // FIXME: leave it "unspecified" by default like the child org schema ? Description: "The access role of the user. Options are `st` (standard user), `adm` (admin user), or `ro` (read-only user). Allowed enum values: `st`, `adm` , `ro`, `ERROR`", ValidateFunc: validation.StringInSlice([]string{"st", "adm", "ro", "ERROR"}, false), }, @@ -253,6 +272,7 @@ func buildDatadogOrganizationUpdateV1Struct(d *schema.ResourceData) *datadogV1.O } func resourceDatadogOrganizationSettingsCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + // note: we don't actually create a new organization, we just import the org associated with the current API/APP keys providerConf := meta.(*ProviderConfiguration) apiInstances := providerConf.DatadogApiInstances auth := providerConf.Auth @@ -286,11 +306,11 @@ func resourceDatadogOrganizationSettingsRead(ctx context.Context, d *schema.Reso } return utils.TranslateClientErrorDiag(err, httpResponse, "error getting organization") } - org := resp.GetOrg() - d.SetId(org.GetPublicId()) - return updateOrganizationState(d, &org) + diags := updateOrganizationState(d, &org) + diags = append(diags, readSecurityContacts(providerConf, d)...) + return diags } func resourceDatadogOrganizationSettingsUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -302,13 +322,11 @@ func resourceDatadogOrganizationSettingsUpdate(ctx context.Context, d *schema.Re if err != nil { return utils.TranslateClientErrorDiag(err, httpResponse, "error updating organization") } - org := resp.GetOrg() - publicId := org.GetPublicId() - d.SetId(publicId) - - return updateOrganizationState(d, &org) + diags := updateOrganizationState(d, &org) + diags = append(diags, updateSecurityContacts(providerConf, d)...) + return diags } func resourceDatadogOrganizationSettingsDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { @@ -320,3 +338,90 @@ func resourceDatadogOrganizationSettingsDelete(ctx context.Context, d *schema.Re Detail: "Remove organization by contacting support (https://docs.datadoghq.com/help/).", }) } + +/// Security Contacts /// + +func readSecurityContacts(pc *ProviderConfiguration, d *schema.ResourceData) diag.Diagnostics { + body, resp, err := pc.DatadogApiInstances.GetOrganizationsApiV2().GetOrgConfig(pc.Auth, "security_contacts") + if err != nil { + // this API should not return 404, a default config value is always provided + return utils.TranslateClientErrorDiag(err, resp, "error getting security_contacts") + } + + return updateSecurityContactState(body, d) +} + +func updateSecurityContacts(pc *ProviderConfiguration, d *schema.ResourceData) diag.Diagnostics { + // ResourceData.HasChange doesn't work well with (nullable) slices: it uses the zero value (empty) even for + // unset config or missing state, so we manually check the raw values. + stateValue, diags := readNullableCtyAttr[[]string](d.GetRawState(), "security_contacts") + if diags != nil { + return diags + } + configValue, diags := readNullableCtyAttr[[]string](d.GetRawConfig(), "security_contacts") + if diags != nil { + return diags + } + + // Skip the update when the config is unset or no change is needed. + if configValue == nil || cmp.Equal(stateValue, configValue) { + if stateValue == nil { // usually happens for brand-new resources + return readSecurityContacts(pc, d) + } + return nil + } + newValue := *configValue + + body, resp, err := pc.DatadogApiInstances.GetOrganizationsApiV2().UpdateOrgConfig(pc.Auth, "security_contacts", datadogV2.OrgConfigWriteRequest{ + Data: datadogV2.OrgConfigWrite{ + Type: "org_configs", // required by the API + Attributes: datadogV2.OrgConfigWriteAttributes{ + Value: newValue, + }, + }, + }) + if err != nil { + return utils.TranslateClientErrorDiag(err, resp, "error setting security_contacts") + } + + // The org_configs read API appears to be eventually consistent, so we wait for reads to return the new value. + // This is obviously a race condition: with concurrent updates we might never witness our own. + ctx := context.Background() + err = retry.RetryContext(ctx, 10*time.Second, func() *retry.RetryError { + body, _, err := pc.DatadogApiInstances.GetOrganizationsApiV2().GetOrgConfig(pc.Auth, "security_contacts") + if err != nil { + return retry.NonRetryableError(fmt.Errorf("unable to check security_contacts: %w", err)) + } + remoteValue := utils.AnyToSlice[string](body.Data.Attributes.Value) + if cmp.Equal(newValue, remoteValue) { + return nil + } else { + return retry.RetryableError(fmt.Errorf("security_contacts not updated yet")) + } + }) + if err != nil { + return diag.FromErr(fmt.Errorf("while waiting for security_contacts update: %w", err)) + } + + return updateSecurityContactState(body, d) +} + +func readNullableCtyAttr[T any](root cty.Value, attr string) (*T, diag.Diagnostics) { + if root.IsNull() { + return nil, nil + } + ctyValue := root.GetAttr(attr) + if ctyValue.IsNull() { + return nil, nil + } + var value T + if err := gocty.FromCtyValue(ctyValue, &value); err != nil { + return nil, diag.FromErr(fmt.Errorf("error reading cty attr '%s': %w", attr, err)) + } + return &value, nil +} + +func updateSecurityContactState(remote datadogV2.OrgConfigGetResponse, d *schema.ResourceData) diag.Diagnostics { + value := utils.AnyToSlice[string](remote.Data.Attributes.Value) + return diag.FromErr(d.Set("security_contacts", value)) +} diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze index 8740d19fed..a1ff979783 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.freeze @@ -1 +1 @@ -2021-08-06T14:58:28.604819+02:00 \ No newline at end of file +2024-06-19T11:38:22.059825+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml index 70e1ae6b9d..df8540988f 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Import.yaml @@ -1,73 +1,251 @@ +--- version: 2 interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org - method: GET - id: 0 - response: - body: '{"orgs":[{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_import-local-1628254627","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}]}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: | - {"name":"ttings_Import-local-1628254708"} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: PUT - id: 1 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 2 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 3 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Import-local-1628254708","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"orgs":[{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-updat2-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}]} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 227.191292ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 43 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-import-718789902"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-import-718789902","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 257.746125ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 144.672875ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-import-718789902","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 237.839917ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 134.957167ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-import-718789902","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 238.462541ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 144.103916ms diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.freeze b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.freeze index 6bbcd2bb9f..a04f5c2637 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.freeze +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.freeze @@ -1 +1 @@ -2021-08-06T09:50:51.293276+02:00 \ No newline at end of file +2024-06-19T11:38:46.094462+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.yaml b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.yaml index 8839ee0fa0..2797c38e00 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.yaml +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_IncorrectName.yaml @@ -1,2 +1,3 @@ +--- version: 2 interactions: [] diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.freeze b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.freeze new file mode 100644 index 0000000000..1d7de18e7c --- /dev/null +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.freeze @@ -0,0 +1 @@ +2024-06-19T11:38:25.686175+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.yaml b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.yaml new file mode 100644 index 0000000000..69f918b8f6 --- /dev/null +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_SecurityContacts.yaml @@ -0,0 +1,1599 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"orgs":[{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-import-718789902","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}]} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 258.366ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 43 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-secCon-718789905"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 250.143125ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 148.347542ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 254.077042ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 131.482208ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 230.662583ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 147.196334ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 319 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-secCon-718789905","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 448.452958ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 75 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"data":{"attributes":{"value":["foo@example.org"]},"type":"org_configs"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: PATCH + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org"],"modified_at":"2024-06-19T09:38:30.232315+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 154.455583ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 130.833334ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org"],"modified_at":"2024-06-19T09:38:30.232315+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 135.14675ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 234.192041ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org"],"modified_at":"2024-06-19T09:38:30.232315+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 144.421458ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 278.3615ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org"],"modified_at":"2024-06-19T09:38:30.232315+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 140.947291ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 319 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-secCon-718789905","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 470.16025ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"data":{"attributes":{"value":["foo@example.org","bar@example.org"]},"type":"org_configs"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: PATCH + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 160.610792ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 138.572ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 245.40425ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 134.67425ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 237.020042ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 133.464875ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 226.647459ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 142.110875ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 263.1425ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 148.484084ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 237.685208ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 139.5965ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 243.126417ms + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 128.321917ms + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 232.332ms + - id: 31 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 139.970333ms + - id: 32 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 269.168708ms + - id: 33 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 138.088917ms + - id: 34 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"orgs":[{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}]} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 247.015666ms + - id: 35 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 43 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-secCon-718789905"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 250.356625ms + - id: 36 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 58 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"data":{"attributes":{"value":[]},"type":"org_configs"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: PATCH + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:38:42.287177+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 152.27875ms + - id: 37 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":["foo@example.org","bar@example.org"],"modified_at":"2024-06-19T09:38:33.810017+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 140.086208ms + - id: 38 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:38:42.287177+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 137.908125ms + - id: 39 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 221.33175ms + - id: 40 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:38:42.287177+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 137.402583ms + - id: 41 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 233.121791ms + - id: 42 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:38:42.287177+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 144.743ms + - id: 43 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789905","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 227.351209ms + - id: 44 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:38:42.287177+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 130.236208ms diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.freeze b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.freeze index 328bc59cfb..c15a285bf0 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.freeze +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.freeze @@ -1 +1 @@ -2021-08-06T09:48:39.525054+02:00 \ No newline at end of file +2024-06-19T11:38:09.597191+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.yaml b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.yaml index 06899892da..a44108ddd8 100644 --- a/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.yaml +++ b/datadog/tests/cassettes/TestAccDatadogOrganizationSettings_Update.yaml @@ -1,198 +1,677 @@ +--- version: 2 interactions: -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org - method: GET - id: 0 - response: - body: '{"orgs":[{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236083-2","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}]}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: | - {"name":"ttings_Update-local-1628236119","settings":{"private_widget_share":false,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: PUT - id: 1 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":false,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 2 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":false,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 3 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":false,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 4 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":false,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 5 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":false,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: | - {"name":"ttings_Update-local-1628236119","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: PUT - id: 6 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 7 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 8 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: | - {"name":"ttings_Update-local-1628236119-2","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: PUT - id: 9 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119-2","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/org/8bc512dc-f4e7-11eb-b98d-da7ad0900002 - method: GET - id: 10 - response: - body: '{"org":{"public_id":"8bc512dc-f4e7-11eb-b98d-da7ad0900002","name":"ttings_Update-local-1628236119-2","billing":{"type":"parent_billing"},"created":"2021-08-04 05:48:08","description":null,"settings":{"saml_idp_metadata_valid_until":null,"saml_autocreate_access_role":"st","private_widget_share":true,"saml_idp_endpoint":null,"saml_idp_metadata_uploaded":false,"saml_can_be_enabled":false,"saml":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_login_url":null},"subscription":{"started":1628056089,"finished":null,"is_custom":false,"is_expired":true,"billing_plan_id":2,"is_trial":false,"expires":null,"type":"pro","id":785813}}}' - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "0ms" + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"orgs":[{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-secCon-718789669","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}]} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 507.656833ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 290 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-update-718789889","settings":{"private_widget_share":false,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":[],"enabled":false},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":false,"domains":[]},"private_widget_share":false,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 475.069041ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 140.661042ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":false,"domains":[]},"private_widget_share":false,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 232.021833ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 161.90275ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":false,"domains":[]},"private_widget_share":false,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 231.356083ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 145.950625ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":false,"domains":[]},"private_widget_share":false,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 230.857916ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 140.352083ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":false,"domains":[]},"private_widget_share":false,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 248.269125ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 138.86475ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 319 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-update-718789889","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 454.769625ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 233.693708ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 138.639333ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-update-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 262.018709ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 143.894291ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 319 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: | + {"name":"tf-plugin-test-updat2-718789889","settings":{"private_widget_share":true,"saml":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"domains":["example.com","www.example.com"],"enabled":true},"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false}}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: PUT + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-updat2-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 387.798333ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v1/org/73282e76-06f0-11ef-8f49-da7ad0900002 + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"org":{"public_id":"73282e76-06f0-11ef-8f49-da7ad0900002","name":"tf-plugin-test-updat2-718789889","description":null,"created":"2024-04-30 12:52:06","subscription":{"id":null,"billing_plan_id":8,"started":1714481527,"expires":null,"finished":null,"type":"dogfood","is_custom":false,"is_trial":false,"is_expired":true},"billing":{"type":"parent_billing"},"settings":{"default_landing_page":"Dashboard Lists","saml":{"enabled":false},"saml_can_be_enabled":false,"saml_login_url":null,"saml_idp_metadata_uploaded":false,"saml_idp_endpoint":null,"saml_idp_metadata_valid_until":null,"custom_landing_page":null,"saml_idp_initiated_login":{"enabled":false},"saml_strict_mode":{"enabled":false},"saml_autocreate_access_role":"st","saml_autocreate_users_domains":{"enabled":true,"domains":["example.com","www.example.com"]},"private_widget_share":true,"manage_reports":null}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 270.979875ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.datadoghq.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + url: https://api.datadoghq.com/api/v2/org_configs/security_contacts + method: GET + response: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked + trailer: {} + content_length: -1 + uncompressed: true + body: | + {"data":{"type":"org_configs","id":"47d07447-cee4-5f45-820a-3595c8c1ce21","attributes":{"name":"security_contacts","description":"List of emails for security event notifications of an organization","value_type":"security_contacts_list","value":[],"modified_at":"2024-06-19T09:34:47.741932+00:00"}}} + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 154.452542ms diff --git a/datadog/tests/resource_datadog_organization_settings_test.go b/datadog/tests/resource_datadog_organization_settings_test.go index 8a172e0897..9f7f8ee3e5 100644 --- a/datadog/tests/resource_datadog_organization_settings_test.go +++ b/datadog/tests/resource_datadog_organization_settings_test.go @@ -9,15 +9,19 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -func TestAccDatadogOrganizationSettings_Update(t *testing.T) { +func preludeAccDatadogOrganizationSettings(t *testing.T) { + // Temporarily comment this whole function to update the cassettes recording if !isReplaying() { t.Skip("This test only supports replaying") } t.Parallel() +} + +func TestAccDatadogOrganizationSettings_Update(t *testing.T) { + preludeAccDatadogOrganizationSettings(t) ctx, accProviders := testAccProviders(context.Background(), t) - uniqueEntity := uniqueEntityName(ctx, t) - organizationName := fmt.Sprint(uniqueEntity[len(uniqueEntity)-30:]) - organizationName2 := organizationName + "-2" + organizationName := uniqueOrgName(ctx, "update") + organizationName2 := uniqueOrgName(ctx, "updat2") resourceName := "datadog_organization_settings.foo" resource.Test(t, resource.TestCase{ @@ -129,14 +133,10 @@ func TestAccDatadogOrganizationSettings_Update(t *testing.T) { } func TestAccDatadogOrganizationSettings_Import(t *testing.T) { - if !isReplaying() { - t.Skip("This test only supports replaying") - } - t.Parallel() + preludeAccDatadogOrganizationSettings(t) resourceName := "datadog_organization_settings.foo" ctx, accProviders := testAccProviders(context.Background(), t) - uniqueEntity := uniqueEntityName(ctx, t) - organizationName := fmt.Sprint(uniqueEntity[len(uniqueEntity)-30:]) + organizationName := uniqueOrgName(ctx, "import") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -154,13 +154,88 @@ func TestAccDatadogOrganizationSettings_Import(t *testing.T) { }) } -func TestAccDatadogOrganizationSettings_IncorrectName(t *testing.T) { - if !isReplaying() { - t.Skip("This test only supports replaying") - } - t.Parallel() +func TestAccDatadogOrganizationSettings_SecurityContacts(t *testing.T) { + preludeAccDatadogOrganizationSettings(t) ctx, accProviders := testAccProviders(context.Background(), t) - organizationName := uniqueEntityName(ctx, t) + "qwertyuiopasdfghjklzxcvbnm0123456" // 32 characters + organizationName := uniqueOrgName(ctx, "secCon") + cfg := func(extra string) string { + return fmt.Sprintf(` + resource datadog_organization_settings foo { + name = "%s" + %s + } + `, organizationName, extra) + } + + resource.Test(t, resource.TestCase{ + IsUnitTest: true, + ProviderFactories: accProviders, + Steps: []resource.TestStep{ + { + Config: cfg(`security_contacts = [null]`), + ExpectError: regexp.MustCompile("Error: Null value found in list"), + }, + { + Config: cfg(`security_contacts = ["foo@example@org"]`), + ExpectError: regexp.MustCompile("Error: not a email: foo@example@org"), + }, + }, + }) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: accProviders, + Steps: []resource.TestStep{ + { + Config: cfg(``), + }, + { + Config: cfg(`security_contacts = ["foo@example.org"]`), + }, + { + Config: cfg(`security_contacts = ["foo@example.org", "bar@example.org"]`), + }, + { + Config: cfg(`security_contacts = ["foo@example.org", "bar@example.org"]`), + PlanOnly: true, // no change + }, + { + ResourceName: "datadog_organization_settings.foo", + Config: cfg(``), + ImportState: true, + ImportStateVerify: true, + }, + { + Config: cfg(`security_contacts = null`), + PlanOnly: true, // not configured, no change + }, + { + Config: cfg(``), + PlanOnly: true, // not configured, no change + }, + }, + }) + + // Starting from scratch, unset the security contacts (test an edge case around zero-values plans) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: accProviders, + Steps: []resource.TestStep{ + { + Config: cfg(`security_contacts = []`), + }, + { + Config: cfg(`security_contacts = []`), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDatadogOrganizationSettings_IncorrectName(t *testing.T) { + preludeAccDatadogOrganizationSettings(t) + _, accProviders := testAccProviders(context.Background(), t) + organizationName := "very-long-and-boring-name-longer-than-32-characters" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -174,6 +249,16 @@ func TestAccDatadogOrganizationSettings_IncorrectName(t *testing.T) { }) } +// uniqueOrgName returns an organization name for a particular test, whose id must be 6 char long at most. +// uniqueEntityName is not suitable because org names are limited to 32 characters. +func uniqueOrgName(ctx context.Context, id string) string { + r := fmt.Sprintf("tf-plugin-test-%s-%d", id, clockFromContext(ctx).Now().Unix()%1e9) + if len(r) > 32 { + panic("uniqueOrgName is too long: " + r) + } + return r +} + func testAccCheckDatadogOrganizationSettingsConfig_Required(uniq string) string { return fmt.Sprintf(` resource "datadog_organization_settings" "foo" { diff --git a/docs/resources/organization_settings.md b/docs/resources/organization_settings.md index b0ecc3ad32..4aaa93b003 100644 --- a/docs/resources/organization_settings.md +++ b/docs/resources/organization_settings.md @@ -25,6 +25,7 @@ resource "datadog_organization_settings" "organization" { ### Optional - `name` (String) Name for Organization. +- `security_contacts` (List of String) List of emails used for security event notifications from the organization. - `settings` (Block List, Max: 1) Organization settings (see [below for nested schema](#nestedblock--settings)) ### Read-Only diff --git a/go.mod b/go.mod index 31d095f01a..7a03cbe0b3 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/terraform-providers/terraform-provider-datadog require ( github.com/DataDog/datadog-api-client-go/v2 v2.26.1-0.20240618193852-3e8041dde616 github.com/DataDog/dd-sdk-go-testing v0.0.0-20211116174033-1cd082e322ad + github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.5.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 @@ -40,7 +41,6 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/pprof v0.0.0-20210423192551-a2663126120b // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect