diff --git a/datadog/fwprovider/resource_datadog_email_domain_allowlist.go b/datadog/fwprovider/resource_datadog_domain_allowlist.go similarity index 93% rename from datadog/fwprovider/resource_datadog_email_domain_allowlist.go rename to datadog/fwprovider/resource_datadog_domain_allowlist.go index aa3116f39..630f38dd1 100644 --- a/datadog/fwprovider/resource_datadog_email_domain_allowlist.go +++ b/datadog/fwprovider/resource_datadog_domain_allowlist.go @@ -82,11 +82,11 @@ func (r *domainAllowlistResource) Read(ctx context.Context, request resource.Rea } domainAllowListData := resp.GetData() - apiEntries, ok := domainAllowListData.Attributes.GetDomainsOk() + apiDomains, ok := domainAllowListData.Attributes.GetDomainsOk() priorEntries := state.Domains - if !compareDomainEntries(priorEntries, *apiEntries) && ok && priorEntries != nil { - r.updateDomainAllowlistEntriesState(ctx, &state, *apiEntries) + if !compareDomainEntries(priorEntries, *apiDomains) && ok && priorEntries != nil { + state.Domains = *apiDomains } r.updateEnableState(ctx, &state, domainAllowListData.GetAttributes()) @@ -184,7 +184,7 @@ func (r *domainAllowlistResource) updateRequestState(ctx context.Context, state } if domains, ok := domainAllowlistAttrs.GetDomainsOk(); ok && len(*domains) > 0 { - r.updateDomainAllowlistEntriesState(ctx, state, *domains) + state.Domains = domainAllowlistAttrs.GetDomains() } } } @@ -195,12 +195,6 @@ func (r *domainAllowlistResource) updateEnableState(ctx context.Context, state * } } -func (r *domainAllowlistResource) updateDomainAllowlistEntriesState(ctx context.Context, state *domainAllowlistResourceModel, domainAllowlistEntries []string) { - var domains []string - domains = append(domains, domainAllowlistEntries...) - state.Domains = domains -} - func buildDomainAllowlistUpdateRequest(state domainAllowlistResourceModel) (*datadogV2.DomainAllowlistRequest, error) { domainAllowlistRequest := datadogV2.NewDomainAllowlistRequestWithDefaults() domainAllowlistData := datadogV2.NewDomainAllowlist(datadogV2.DOMAINALLOWLISTTYPE_DOMAIN_ALLOWLIST) diff --git a/datadog/resource_datadog_dashboard.go b/datadog/resource_datadog_dashboard.go index c5e81325f..f84d89edd 100644 --- a/datadog/resource_datadog_dashboard.go +++ b/datadog/resource_datadog_dashboard.go @@ -8068,7 +8068,6 @@ func buildDatadogToplistStyle(terraformToplistStyle map[string]interface{}) data if t == "stacked" { datadogToplistStyle.SetDisplay(datadogV1.ToplistWidgetDisplay{ ToplistWidgetStacked: datadogV1.NewToplistWidgetStacked( - datadogV1.TOPLISTWIDGETLEGEND_AUTOMATIC, datadogV1.TOPLISTWIDGETSTACKEDTYPE_STACKED, ), }) diff --git a/datadog/resource_datadog_synthetics_test_.go b/datadog/resource_datadog_synthetics_test_.go index 8dcadc35b..06fd922c2 100644 --- a/datadog/resource_datadog_synthetics_test_.go +++ b/datadog/resource_datadog_synthetics_test_.go @@ -3114,10 +3114,7 @@ func buildDatadogTestOptions(d *schema.ResourceData) *datadogV1.SyntheticsTestOp if rawTimeframes, ok := scheduling.(map[string]interface{})["timeframes"]; ok { var timeFrames []datadogV1.SyntheticsTestOptionsSchedulingTimeframe for _, tf := range rawTimeframes.(*schema.Set).List() { - timeframe := datadogV1.NewSyntheticsTestOptionsSchedulingTimeframe() - timeframe.SetDay(int32(tf.(map[string]interface{})["day"].(int))) - timeframe.SetFrom(tf.(map[string]interface{})["from"].(string)) - timeframe.SetTo(tf.(map[string]interface{})["to"].(string)) + timeframe := datadogV1.NewSyntheticsTestOptionsSchedulingTimeframe(int32(tf.(map[string]interface{})["day"].(int)), tf.(map[string]interface{})["from"].(string), tf.(map[string]interface{})["to"].(string)) timeFrames = append(timeFrames, *timeframe) } optionsScheduling.SetTimeframes(timeFrames) diff --git a/datadog/tests/provider_test.go b/datadog/tests/provider_test.go index 5b1c8984f..8407fb8b8 100644 --- a/datadog/tests/provider_test.go +++ b/datadog/tests/provider_test.go @@ -146,6 +146,7 @@ var testFiles2EndpointTags = map[string]string{ "tests/resource_datadog_dashboard_topology_map_test": "dashboards", "tests/resource_datadog_dashboard_trace_service_test": "dashboards", "tests/resource_datadog_dashboard_treemap_test": "dashboards", + "tests/resource_datadog_domain_allowlist_test": "domain-allowlist", "tests/resource_datadog_openapi_api_test": "apimanagement", "tests/resource_datadog_powerpack_test": "powerpacks", "tests/resource_datadog_powerpack_alert_graph_test": "powerpacks",