Skip to content

Commit

Permalink
Remove unused mappings (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe authored Jun 14, 2024
1 parent 6086e86 commit 868485c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 81 deletions.
1 change: 0 additions & 1 deletion provider/cmd/pulumi-resource-datadog/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"azure": "Azure",
"datadog": "Datadog",
"gcp": "Gcp",
"index": "index",
"opsgenie": "OpsGenie",
"pagerduty": "PagerDuty",
"slack": "Slack"
Expand Down
91 changes: 11 additions & 80 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"context"
_ "embed"
"fmt"
"path/filepath"
"path"
"strings"
"unicode"

Expand All @@ -25,7 +25,7 @@ const (
// packages:
datadogPkg = "datadog"
// modules:
datadogMod = "index"
mainMod = "index"
gcpMod = "Gcp"
awsMod = "Aws"
azureMod = "Azure"
Expand Down Expand Up @@ -85,50 +85,14 @@ func Provider() tfbridge.ProviderInfo {
GitHubOrg: "DataDog",
DocRules: &tfbridge.DocRuleInfo{EditRules: docEditRules},
Resources: map[string]*tfbridge.ResourceInfo{
"datadog_dashboard": {Tok: makeResource(datadogMod, "Dashboard")},
"datadog_downtime": {Tok: makeResource(datadogMod, "Downtime")},
"datadog_metric_metadata": {Tok: makeResource(datadogMod, "MetricMetadata")},
"datadog_monitor": {Tok: makeResource(datadogMod, "Monitor")},
"datadog_user": {Tok: makeResource(datadogMod, "User")},
"datadog_synthetics_test": {Tok: makeResource(datadogMod, "SyntheticsTest")},
"datadog_synthetics_global_variable": {Tok: makeResource(datadogMod, "SyntheticsGlobalVariable")},
"datadog_dashboard_list": {Tok: makeResource(datadogMod, "DashboardList")},
"datadog_service_level_objective": {Tok: makeResource(datadogMod, "ServiceLevelObjective")},
"datadog_logs_custom_pipeline": {Tok: makeResource(datadogMod, "LogsCustomPipeline")},
"datadog_logs_index": {
Tok: makeResource(datadogMod, "LogsIndex"),
Fields: map[string]*tfbridge.SchemaInfo{
"filter": {
Name: "filters",
MaxItemsOne: tfbridge.False(),
},
},
},
"datadog_logs_metric": {Tok: makeResource(datadogMod, "LogsMetric")},
"datadog_logs_archive": {Tok: makeResource(datadogMod, "LogsArchive")},
"datadog_logs_index_order": {Tok: makeResource(datadogMod, "LogsIndexOrder")},
"datadog_logs_integration_pipeline": {Tok: makeResource(datadogMod, "LogsIntegrationPipeline")},
"datadog_logs_pipeline_order": {Tok: makeResource(datadogMod, "LogsPipelineOrder")},
"datadog_logs_archive_order": {Tok: makeResource(datadogMod, "LogsArchiveOrder")},
"datadog_role": {Tok: makeResource(datadogMod, "Role")},
"datadog_security_monitoring_rule": {Tok: makeResource(datadogMod, "SecurityMonitoringRule")},
"datadog_security_monitoring_default_rule": {Tok: makeResource(datadogMod, "SecurityMonitoringDefaultRule")},
"datadog_synthetics_private_location": {Tok: makeResource(datadogMod, "SyntheticsPrivateLocation")},
"datadog_dashboard_json": {Tok: makeResource(datadogMod, "DashboardJson")},
"datadog_metric_tag_configuration": {Tok: makeResource(datadogMod, "MetricTagConfiguration")},
"datadog_slo_correction": {Tok: makeResource(datadogMod, "SloCorrection")},
"datadog_api_key": {Tok: makeResource(datadogMod, "ApiKey")},
"datadog_application_key": {Tok: makeResource(datadogMod, "ApplicationKey")},
"datadog_child_organization": {Tok: makeResource(datadogMod, "ChildOrganization")},
"datadog_organization_settings": {Tok: makeResource(datadogMod, "OrganizationSettings")},
"datadog_security_monitoring_filter": {Tok: makeResource(datadogMod, "SecurityMonitoringFilter")},
"datadog_monitor_json": {Tok: makeResource(datadogMod, "MonitorJson")},
"datadog_webhook": {Tok: makeResource(datadogMod, "Webhook")},
"datadog_webhook_custom_variable": {Tok: makeResource(datadogMod, "WebhookCustomVariable")},
"datadog_authn_mapping": {Tok: makeResource(datadogMod, "AuthnMapping")},
"datadog_cloud_workload_security_agent_rule": {Tok: makeResource(datadogMod, "CloudWorkloadSecurityAgentRule")},
"datadog_rum_application": {Tok: makeResource(datadogMod, "RumApplication")},
"datadog_service_definition_yaml": {Tok: makeResource(datadogMod, "ServiceDefinitionYaml")},

// GCP Integrations
"datadog_integration_gcp": {Tok: makeResource(gcpMod, "Integration")},
Expand All @@ -153,35 +117,6 @@ func Provider() tfbridge.ProviderInfo {
"datadog_integration_opsgenie_service_object": {Tok: makeResource(opsGenieMod, "ServiceObject")},
},
DataSources: map[string]*tfbridge.DataSourceInfo{
"datadog_ip_ranges": {
Tok: makeDataSource(datadogMod, "getIpRanges"),
},
"datadog_monitor": {
Tok: makeDataSource(datadogMod, "getMonitor"),
},
"datadog_dashboard_list": {Tok: makeDataSource(datadogMod, "getDashboardList")},
"datadog_dashboard": {Tok: makeDataSource(datadogMod, "getDashboard")},
"datadog_synthetics_locations": {Tok: makeDataSource(datadogMod, "getSyntheticsLocations")},
"datadog_permissions": {Tok: makeDataSource(datadogMod, "getPermissions")},
"datadog_role": {Tok: makeDataSource(datadogMod, "getRole")},
"datadog_security_monitoring_rules": {Tok: makeDataSource(datadogMod, "getSecurityMonitoringRules")},
"datadog_monitors": {Tok: makeDataSource(datadogMod, "getMonitors")},
"datadog_service_level_objective": {Tok: makeDataSource(datadogMod, "getServiceLevelObjective")},
"datadog_service_level_objectives": {Tok: makeDataSource(datadogMod, "getServiceLevelObjectives")},
"datadog_api_key": {Tok: makeDataSource(datadogMod, "getApiKey")},
"datadog_application_key": {Tok: makeDataSource(datadogMod, "getApplicationKey")},
"datadog_security_monitoring_filters": {Tok: makeDataSource(datadogMod, "getSecurityMonitoringFilters")},
"datadog_synthetics_global_variable": {Tok: makeDataSource(datadogMod, "getSyntheticsGlobalVariable")},
"datadog_user": {Tok: makeDataSource(datadogMod, "getUser")},
"datadog_roles": {Tok: makeDataSource(datadogMod, "getRoles")},
"datadog_logs_archives_order": {Tok: makeDataSource(datadogMod, "getLogsArchivesOrder")},
"datadog_logs_indexes": {Tok: makeDataSource(datadogMod, "getLogsIndexes")},
"datadog_logs_indexes_order": {Tok: makeDataSource(datadogMod, "getLogsIndexesOrder")},
"datadog_logs_pipelines": {Tok: makeDataSource(datadogMod, "getLogsPipelines")},
"datadog_cloud_workload_security_agent_rules": {Tok: makeDataSource(datadogMod, "getCloudWorkloadSecurityAgentRules")},
"datadog_rum_application": {Tok: makeDataSource(datadogMod, "getRumApplication")},
"datadog_synthetics_test": {Tok: makeDataSource(datadogMod, "getSyntheticsTest")},

"datadog_integration_aws_logs_services": {Tok: makeDataSource(awsMod, "getIntegrationLogsServices")},
},
JavaScript: &tfbridge.JavaScriptInfo{
Expand All @@ -194,7 +129,7 @@ func Provider() tfbridge.ProviderInfo {
RespectSchemaVersion: true,
},
Golang: &tfbridge.GolangInfo{
ImportBasePath: filepath.Join(
ImportBasePath: path.Join(
fmt.Sprintf("github.com/pulumi/pulumi-%[1]s/sdk/", datadogPkg),
tfbridge.GetModuleMajorVersion(version.Version),
"go",
Expand All @@ -203,17 +138,13 @@ func Provider() tfbridge.ProviderInfo {
GenerateResourceContainerTypes: true,
RespectSchemaVersion: true,
},
Python: (func() *tfbridge.PythonInfo {
i := &tfbridge.PythonInfo{
RespectSchemaVersion: true,
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
}
i.PyProject.Enabled = true
return i
})(),

Python: &tfbridge.PythonInfo{
RespectSchemaVersion: true,
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
PyProject: struct{ Enabled bool }{true},
},
CSharp: &tfbridge.CSharpInfo{
RespectSchemaVersion: true,
PackageReferences: map[string]string{
Expand All @@ -223,7 +154,7 @@ func Provider() tfbridge.ProviderInfo {
},
}

strategy := tks.KnownModules("datadog_", datadogMod, []string{
strategy := tks.KnownModules("datadog_", mainMod, []string{
"integration",
},
func(module, name string) (string, error) {
Expand Down

0 comments on commit 868485c

Please sign in to comment.