Skip to content

Commit

Permalink
[datadog_logs_custom_destination] Introduce logs custom destination r…
Browse files Browse the repository at this point in the history
…esource (#2542)

* Added logs custom destination resource

* Added logs custom destination resource tests

* Added logs custom destination example

* Generated docs for logs custom destinations

* Fixed being unable to unset forward_tags_restriction_list
  • Loading branch information
Prepager authored Aug 29, 2024
1 parent 7d885fe commit e16acd6
Show file tree
Hide file tree
Showing 10 changed files with 1,355 additions and 37 deletions.
83 changes: 46 additions & 37 deletions datadog/internal/utils/api_instances_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,43 +44,44 @@ type ApiInstances struct {
webhooksIntegrationApiV1 *datadogV1.WebhooksIntegrationApi

//V2 APIs
apiManagementAPIV2 *datadogV2.APIManagementApi
apmRetentionFiltersApiV2 *datadogV2.APMRetentionFiltersApi
auditApiV2 *datadogV2.AuditApi
authNMappingsApiV2 *datadogV2.AuthNMappingsApi
cloudflareIntegrationApiV2 *datadogV2.CloudflareIntegrationApi
csmThreatsApiV2 *datadogV2.CSMThreatsApi
confluentCloudApiV2 *datadogV2.ConfluentCloudApi
dashboardListsApiV2 *datadogV2.DashboardListsApi
downtimesApiV2 *datadogV2.DowntimesApi
eventsApiV2 *datadogV2.EventsApi
fastlyIntegrationApiV2 *datadogV2.FastlyIntegrationApi
gcpStsIntegrationApiV2 *datadogV2.GCPIntegrationApi
incidentServicesApiV2 *datadogV2.IncidentServicesApi
incidentTeamsApiV2 *datadogV2.IncidentTeamsApi
incidentsApiV2 *datadogV2.IncidentsApi
ipAllowlistApiV2 *datadogV2.IPAllowlistApi
keyManagementApiV2 *datadogV2.KeyManagementApi
logsApiV2 *datadogV2.LogsApi
logsArchivesApiV2 *datadogV2.LogsArchivesApi
logsMetricsApiV2 *datadogV2.LogsMetricsApi
metricsApiV2 *datadogV2.MetricsApi
monitorsApiV2 *datadogV2.MonitorsApi
opsgenieIntegrationApiV2 *datadogV2.OpsgenieIntegrationApi
organizationsApiV2 *datadogV2.OrganizationsApi
processesApiV2 *datadogV2.ProcessesApi
powerpackApiV2 *datadogV2.PowerpackApi
restrictionPolicyApiV2 *datadogV2.RestrictionPoliciesApi
rolesApiV2 *datadogV2.RolesApi
rumApiV2 *datadogV2.RUMApi
securityMonitoringApiV2 *datadogV2.SecurityMonitoringApi
sensitiveDataScannerApiV2 *datadogV2.SensitiveDataScannerApi
serviceAccountsApiV2 *datadogV2.ServiceAccountsApi
spansMetricsApiV2 *datadogV2.SpansMetricsApi
syntheticsApiV2 *datadogV2.SyntheticsApi
teamsApiV2 *datadogV2.TeamsApi
usageMeteringApiV2 *datadogV2.UsageMeteringApi
usersApiV2 *datadogV2.UsersApi
apiManagementAPIV2 *datadogV2.APIManagementApi
apmRetentionFiltersApiV2 *datadogV2.APMRetentionFiltersApi
auditApiV2 *datadogV2.AuditApi
authNMappingsApiV2 *datadogV2.AuthNMappingsApi
cloudflareIntegrationApiV2 *datadogV2.CloudflareIntegrationApi
csmThreatsApiV2 *datadogV2.CSMThreatsApi
confluentCloudApiV2 *datadogV2.ConfluentCloudApi
dashboardListsApiV2 *datadogV2.DashboardListsApi
downtimesApiV2 *datadogV2.DowntimesApi
eventsApiV2 *datadogV2.EventsApi
fastlyIntegrationApiV2 *datadogV2.FastlyIntegrationApi
gcpStsIntegrationApiV2 *datadogV2.GCPIntegrationApi
incidentServicesApiV2 *datadogV2.IncidentServicesApi
incidentTeamsApiV2 *datadogV2.IncidentTeamsApi
incidentsApiV2 *datadogV2.IncidentsApi
ipAllowlistApiV2 *datadogV2.IPAllowlistApi
keyManagementApiV2 *datadogV2.KeyManagementApi
logsApiV2 *datadogV2.LogsApi
logsArchivesApiV2 *datadogV2.LogsArchivesApi
logsCustomDestinationsApiV2 *datadogV2.LogsCustomDestinationsApi
logsMetricsApiV2 *datadogV2.LogsMetricsApi
metricsApiV2 *datadogV2.MetricsApi
monitorsApiV2 *datadogV2.MonitorsApi
opsgenieIntegrationApiV2 *datadogV2.OpsgenieIntegrationApi
organizationsApiV2 *datadogV2.OrganizationsApi
processesApiV2 *datadogV2.ProcessesApi
powerpackApiV2 *datadogV2.PowerpackApi
restrictionPolicyApiV2 *datadogV2.RestrictionPoliciesApi
rolesApiV2 *datadogV2.RolesApi
rumApiV2 *datadogV2.RUMApi
securityMonitoringApiV2 *datadogV2.SecurityMonitoringApi
sensitiveDataScannerApiV2 *datadogV2.SensitiveDataScannerApi
serviceAccountsApiV2 *datadogV2.ServiceAccountsApi
spansMetricsApiV2 *datadogV2.SpansMetricsApi
syntheticsApiV2 *datadogV2.SyntheticsApi
teamsApiV2 *datadogV2.TeamsApi
usageMeteringApiV2 *datadogV2.UsageMeteringApi
usersApiV2 *datadogV2.UsersApi
}

// GetAuthenticationApiV1 get instance of AuthenticationApi
Expand Down Expand Up @@ -442,6 +443,14 @@ func (i *ApiInstances) GetLogsArchivesApiV2() *datadogV2.LogsArchivesApi {
return i.logsArchivesApiV2
}

// GetLogsCustomDestinationsApiV2 get instance of NewLogsCustomDestinationApi
func (i *ApiInstances) GetLogsCustomDestinationsApiV2() *datadogV2.LogsCustomDestinationsApi {
if i.logsCustomDestinationsApiV2 == nil {
i.logsCustomDestinationsApiV2 = datadogV2.NewLogsCustomDestinationsApi(i.HttpClient)
}
return i.logsCustomDestinationsApiV2
}

// GetLogsMetricsApiV2 get instance of LogsMetricsApi
func (i *ApiInstances) GetLogsMetricsApiV2() *datadogV2.LogsMetricsApi {
if i.logsMetricsApiV2 == nil {
Expand Down
1 change: 1 addition & 0 deletions datadog/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func Provider() *schema.Provider {
"datadog_integration_slack_channel": resourceDatadogIntegrationSlackChannel(),
"datadog_logs_archive": resourceDatadogLogsArchive(),
"datadog_logs_archive_order": resourceDatadogLogsArchiveOrder(),
"datadog_logs_custom_destination": resourceDatadogLogsCustomDestination(),
"datadog_logs_custom_pipeline": resourceDatadogLogsCustomPipeline(),
"datadog_logs_index": resourceDatadogLogsIndex(),
"datadog_logs_index_order": resourceDatadogLogsIndexOrder(),
Expand Down
Loading

0 comments on commit e16acd6

Please sign in to comment.