diff --git a/provider/pkg/resources/resources.go b/provider/pkg/resources/resources.go index 1ead29442d97..f5253c8a9697 100644 --- a/provider/pkg/resources/resources.go +++ b/provider/pkg/resources/resources.go @@ -295,7 +295,7 @@ func GetModuleName(majorVersion uint64, filePath, apiUri string) (ModuleNaming, // Start with extracting the namespace from the folder path. If the folder name is explicitly listed, // use it as the module name. This is the new style we use for newer resources after 1.0. Older // resources to be migrated as part of https://github.com/pulumi/pulumi-azure-native/issues/690. - if override, hasOverride := getNameOverride(majorVersion, specFolderName, namespaceWithoutPrefixFromSpecFilePath); hasOverride { + if override, hasOverride := getNameOverride(majorVersion, specFolderName); hasOverride { return ModuleNaming{ ResolvedName: override, SpecFolderName: specFolderName, @@ -318,29 +318,37 @@ func GetModuleName(majorVersion uint64, filePath, apiUri string) (ModuleNaming, }, nil } -var modulesNamedByFolder = map[string]ModuleName{ +var v2ModulesNamedByFolder = map[string]ModuleName{ "videoanalyzer": "VideoAnalyzer", "webpubsub": "WebPubSub", } -var moduleNameOverridesWithAliases = map[string]map[string]string{ - "Network": { - "dns": "Dns", - "dnsresolver": "DnsResolver", - "frontdoor": "FrontDoor", - "privatedns": "PrivateDns", - "trafficmanager": "TrafficManager", - }, - "DocumentDB": { - "mongocluster": "MongoCluster", - }, +var v3ModulesNamedByFolder = map[string]ModuleName{ + // "Network": + "dns": "Dns", + "dnsresolver": "DnsResolver", + "frontdoor": "FrontDoor", + "privatedns": "PrivateDns", + "trafficmanager": "TrafficManager", + // Cache: + "redis": "Redis", + "redisenterprise": "RedisEnterprise", + // Devices: + "iothub": "IoTHub", + "deviceprovisioningservices": "DeviceProvisioningServices", + // "DocumentDB": + "cosmos-db": "CosmosDB", + "mongocluster": "MongoCluster", + // Insights: + "monitor": "Monitor", + "applicationinsights": "ApplicationInsights", } // getNameOverride returns a name override for a given folder name, and non-prefixed namespace. // The second return value is true if an override is found. -func getNameOverride(majorVersion uint64, specFolderName, namespaceWithoutPrefix string) (ModuleName, bool) { +func getNameOverride(majorVersion uint64, specFolderName string) (ModuleName, bool) { // For the cases below, we use folder (SDK) moduleName for module names instead of the ARM moduleName. - if moduleName, ok := modulesNamedByFolder[specFolderName]; ok { + if moduleName, ok := v2ModulesNamedByFolder[specFolderName]; ok { return moduleName, true } // Disable additional rules for v2 and below. @@ -349,10 +357,8 @@ func getNameOverride(majorVersion uint64, specFolderName, namespaceWithoutPrefix return "", false } // New rules for v3 and above which include aliases back to the original namespace. - if namespaceOverrides, ok := moduleNameOverridesWithAliases[namespaceWithoutPrefix]; ok { - if folderName, ok := namespaceOverrides[specFolderName]; ok { - return ModuleName(folderName), true - } + if moduleName, ok := v3ModulesNamedByFolder[specFolderName]; ok { + return moduleName, true } return "", false } @@ -412,7 +418,7 @@ func findNamespaceWithoutPrefixFromPath(path, defaultValue string) string { return defaultValue } -var folderModulePattern = regexp.MustCompile(`.*/specification/([a-zA-Z]+)/resource-manager/.*`) +var folderModulePattern = regexp.MustCompile(`.*/specification/([a-zA-Z-]+)/resource-manager/.*`) func getSpecFolderName(path string) string { subMatches := folderModulePattern.FindStringSubmatch(path) diff --git a/versions/v3-config.yaml b/versions/v3-config.yaml index 41ae20bacaf0..8e7f6793a455 100644 --- a/versions/v3-config.yaml +++ b/versions/v3-config.yaml @@ -71,6 +71,12 @@ AppComplianceAutomation: AppConfiguration: exclusions: listConfigurationStoreKeyValue: "2020-06-01" # was renamed to KeyValues_ListByConfigurationStore, endpoint from listKeyValue to keyValues +ApplicationInsights: + explicit: true + notes: | + Each API version only includes changed resources so no benefit in tracking a version + Path: /azure-rest-api-specs/specification/applicationinsights/resource-manager/Microsoft.Insights + Docs: https://learn.microsoft.com/en-us/rest/api/application-insights/ AppPlatform: notes: | AppPlatform is also called "Azure Spring Apps". @@ -397,14 +403,6 @@ HybridNetwork: notes: | https://learn.microsoft.com/en-us/rest/api/hybridnetwork/ ImportExport: -Insights: - explicit: true - notes: | - Each API version only includes changed resources so no benefit in tracking a version - Path: /azure-rest-api-specs/specification/applicationinsights/resource-manager/Microsoft.Insights - Docs: https://learn.microsoft.com/en-us/rest/api/application-insights/ - - Components and Web Tests pinned on 2015-05-01 - - Workbooks pinned on 2021-08-01 Intune: expectTracking: preview notes: Only preview versions @@ -531,8 +529,13 @@ MobileNetwork: notes: | https://learn.microsoft.com/en-us/rest/api/mobilenetwork/mobile-networks Monitor: + explicit: true notes: | - This is *not* Azure Monitor + Each API version only includes changed resources so no benefit in tracking a version + Docs: https://learn.microsoft.com/en-us/rest/api/monitor/ + This was previously known as Insights (included in the namespace), which is now referred to as "Classic Insights". + This has more recently been renamed to "Monitor", with the addition of the Microsoft.Monitor namespace. + The new Monitor namespace contains a "Workspace" resource to which the "classic" insights resources are parented to to modernize them. NetApp: Network: explicit: true