{{ $useHeaderRow := .Get "header" }} {{ $csv := .Get "csv" }} {{ $file := readFile $csv }} {{ $rows := $file | transform.Unmarshal (dict "delimiter" ",") }} {{ $rows = after 1 $rows }} {{ $useLinks := .Get "useLinks" | default true }} {{ $language := .Get "language" }} {{ $moduleType := .Get "moduleType" }} {{ $include := .Get "include" }} {{ $ProviderNamespaceColumnId := 0 }} {{ $ResourceTypeColumnId := 0 }} {{ $ModuleDisplayNameColumnId := 0 }} {{ $AlternativeNamesColumnId := 0 }} {{ $ModuleNameColumnId := 0 }} {{ $ParentModuleColumnId := 0 }} {{ $ModuleStatusColumnId := 0 }} {{ $RepoURLColumnId := 0 }} {{ $PublicRegistryReferenceColumnId := 0 }} {{ $TelemetryIdPrefixColumnId := 0 }} {{ $PrimaryModuleOwnerGHHandleColumnId := 0 }} {{ $PrimaryModuleOwnerDisplayNameColumnId := 0 }} {{ $SecondaryModuleOwnerGHHandleColumnId := 0 }} {{ $SecondaryModuleOwnerDisplayNameColumnId := 0 }} {{ $ModuleOwnersGHTeamColumnId := 0 }} {{ $DescriptionColumnId := 0 }} {{ $CommentsColumnId := 0 }} {{ $FirstPublishedInColumnId := 0 }} {{ $hasListableModules := false }} {{ $maps := slice }} {{ $i := 0 }} {{ $moduleLatestVersion := "" }} {{ if eq $moduleType "resource" }} {{ $ProviderNamespaceColumnId = 0 }} {{ $ResourceTypeColumnId = 1 }} {{ $ModuleDisplayNameColumnId = 2 }} {{ $AlternativeNamesColumnId = 3 }} {{ $ModuleNameColumnId = 4 }} {{ $ParentModuleColumnId = 5 }} {{ $ModuleStatusColumnId = 6 }} {{ $RepoURLColumnId = 7 }} {{ $PublicRegistryReferenceColumnId = 8 }} {{ if eq $language "Bicep" }} {{ $TelemetryIdPrefixColumnId = 9 }} {{ $PrimaryModuleOwnerGHHandleColumnId = 10 }} {{ $PrimaryModuleOwnerDisplayNameColumnId = 11 }} {{ $SecondaryModuleOwnerGHHandleColumnId = 12 }} {{ $SecondaryModuleOwnerDisplayNameColumnId = 13 }} {{ $ModuleOwnersGHTeamColumnId = 14 }} {{ $DescriptionColumnId = 15 }} {{ $CommentsColumnId = 16 }} {{ $FirstPublishedInColumnId = 17 }} {{ else }} {{ $PrimaryModuleOwnerGHHandleColumnId = 9 }} {{ $PrimaryModuleOwnerDisplayNameColumnId = 10 }} {{ $SecondaryModuleOwnerGHHandleColumnId = 11 }} {{ $SecondaryModuleOwnerDisplayNameColumnId = 12 }} {{ $DescriptionColumnId = 13 }} {{ $CommentsColumnId = 14 }} {{ $FirstPublishedInColumnId = 15 }} {{ end }} {{ range $row, $rows }} {{ $map := dict "ProviderNamespace" (index $row $ProviderNamespaceColumnId) "ResourceType" (index $row $ResourceTypeColumnId) "ModuleDisplayName" (index $row $ModuleDisplayNameColumnId) "AlternativeNames" (index $row $AlternativeNamesColumnId) "ModuleName" (index $row $ModuleNameColumnId) "ParentModule" (index $row $ParentModuleColumnId) "ModuleStatus" (index $row $ModuleStatusColumnId) "RepoURL" (index $row $RepoURLColumnId) "PublicRegistryReference" (index $row $PublicRegistryReferenceColumnId) "PrimaryModuleOwnerGHHandle" (index $row $PrimaryModuleOwnerGHHandleColumnId) "PrimaryModuleOwnerDisplayName" (index $row $PrimaryModuleOwnerDisplayNameColumnId) "SecondaryModuleOwnerGHHandle" (index $row $SecondaryModuleOwnerGHHandleColumnId) "SecondaryModuleOwnerDisplayName" (index $row $SecondaryModuleOwnerDisplayNameColumnId) "Description" (index $row $DescriptionColumnId) "Comments" (index $row $CommentsColumnId) "FirstPublishedInColumnId" (index $row $FirstPublishedInColumnId) }} {{ $maps = $maps | append $map }} {{ end }} {{ else if or (eq $moduleType "pattern") (eq $moduleType "utility") }} {{ $ModuleDisplayNameColumnId = 0 }} {{ $AlternativeNamesColumnId = 1 }} {{ $ModuleNameColumnId = 2 }} {{ $ModuleStatusColumnId = 3 }} {{ $RepoURLColumnId = 4 }} {{ $PublicRegistryReferenceColumnId = 5 }} {{ if eq $language "Bicep" }} {{ $TelemetryIdPrefixColumnId = 6 }} {{ $PrimaryModuleOwnerGHHandleColumnId = 7 }} {{ $PrimaryModuleOwnerDisplayNameColumnId = 8 }} {{ $SecondaryModuleOwnerGHHandleColumnId = 9 }} {{ $SecondaryModuleOwnerDisplayNameColumnId = 10 }} {{ $ModuleOwnersGHTeamColumnId = 11 }} {{ $DescriptionColumnId = 12 }} {{ $CommentsColumnId = 13 }} {{ $FirstPublishedInColumnId = 14 }} {{ else }} {{ $PrimaryModuleOwnerGHHandleColumnId = 6 }} {{ $PrimaryModuleOwnerDisplayNameColumnId = 7 }} {{ $SecondaryModuleOwnerGHHandleColumnId = 8 }} {{ $SecondaryModuleOwnerDisplayNameColumnId = 9 }} {{ $DescriptionColumnId = 10 }} {{ $CommentsColumnId = 11 }} {{ $FirstPublishedInColumnId = 12 }} {{ end }} {{ range $row, $rows }} {{ $map := dict "ModuleDisplayName" (index $row $ModuleDisplayNameColumnId) "AlternativeNames" (index $row $AlternativeNamesColumnId) "ModuleName" (index $row $ModuleNameColumnId) "ModuleStatus" (index $row $ModuleStatusColumnId) "RepoURL" (index $row $RepoURLColumnId) "PublicRegistryReference" (index $row $PublicRegistryReferenceColumnId) "PrimaryModuleOwnerGHHandle" (index $row $PrimaryModuleOwnerGHHandleColumnId) "PrimaryModuleOwnerDisplayName" (index $row $PrimaryModuleOwnerDisplayNameColumnId) "SecondaryModuleOwnerGHHandle" (index $row $SecondaryModuleOwnerGHHandleColumnId) "SecondaryModuleOwnerDisplayName" (index $row $SecondaryModuleOwnerDisplayNameColumnId) "Description" (index $row $DescriptionColumnId) "Comments" (index $row $CommentsColumnId) "FirstPublishedInColumnId" (index $row $FirstPublishedInColumnId) }} {{ $maps = $maps | append $map }} {{ end }} {{ else }} {{ errorf "The %q shortcode requires a moduleType parameter to bet set to either 'resource', 'pattern' or 'utility'. See %s" .Name .Position }} {{ end }} {{ $maps = sort $maps "ModuleName" }} {{ $i = 1 }} {{/* CAF recommended abbreviations lookup (resource modules only). Built once per build via partialCached. */}} {{ $cafRows := slice }} {{ if eq $moduleType "resource" }} {{ $cafRows = partialCached "caf-abbreviation-map.html" . "caf-abbreviation-map" }} {{ end }} {{ if eq $language "Bicep" }}
| No. | Module Name | Display Name | {{- if eq $moduleType "resource" }}CAF Abbreviation | {{- end }}Status & Versions | Owner(s) |
|---|---|---|---|---|---|
| {{/* row index */}} {{- printf "%02d" $i -}} {{- $i = add $i 1 -}} | {{/* module name and link to the repo */}} {{ if $useLinks }} {{- if or (eq $item.ModuleStatus "Available") (eq $item.ModuleStatus "Orphaned") (eq $item.ModuleStatus "Deprecated") -}} {{ $item.ModuleName }} {{- else -}} {{ $item.ModuleName }} {{- end -}} {{- else -}} {{ $item.ModuleName }} {{- end -}} {{- partial "render-child-modules.html" (dict "maps" $maps "parentName" $item.ModuleName "useLinks" $useLinks "language" $language) -}} | {{/* display name and alternative names */}}
{{- with $trimmedAlternativeNames -}}
{{ $item.ModuleDisplayName }}
{{ $trimmedAlternativeNames }} {{- else -}} {{ $item.ModuleDisplayName }} {{- end -}} |
{{- if eq $moduleType "resource" -}}
{{/* CAF recommended abbreviation(s) */}} {{- $cafNs := lower (printf "%s/%s" $item.ProviderNamespace $item.ResourceType) -}} {{- partial "caf-abbreviation.html" (dict "rows" $cafRows "ns" $cafNs) -}} | {{- end -}} {{/* availability badge and versions */}}
{{- if and (or (eq $item.ModuleStatus "Available") (eq $item.ModuleStatus "Orphaned") (eq $item.ModuleStatus "Deprecated")) (ne $item.PublicRegistryReference "n/a") -}}
|
{{/* module owners */}}
{{- if ne $item.PrimaryModuleOwnerGHHandle "" -}}
{{ $item.PrimaryModuleOwnerGHHandle }}
{{- if and (ne $item.PrimaryModuleOwnerGHHandle "") (ne $item.PrimaryModuleOwnerDisplayName "") -}}
{{ $item.PrimaryModuleOwnerDisplayName }} {{- end -}} {{/* {{- if and (ne $item.PrimaryModuleOwnerGHHandle "") (ne $item.PrimaryModuleOwnerDisplayName "") -}} */}} {{- end -}} {{/* {{- if ne $item.PrimaryModuleOwnerGHHandle "" -}} */}} {{- if ne $item.SecondaryModuleOwnerGHHandle "" -}} {{ $item.SecondaryModuleOwnerGHHandle }} {{- if and (ne $item.SecondaryModuleOwnerGHHandle "") (ne $item.SecondaryModuleOwnerDisplayName "") -}} {{ $item.SecondaryModuleOwnerDisplayName }} {{- end -}} {{/* {{- if and (ne $item.SecondaryModuleOwnerGHHandle "") (ne $item.SecondaryModuleOwnerDisplayName "") -}} */}} {{- end -}} {{/* {{- if ne $item.SecondaryModuleOwnerGHHandle "" -}} */}} |
{{- end -}} {{/* end of if moduleType */}}
| {{ printf "%02d" $i }}{{ $i = add $i 1 }} | ❌ None listed | ❌ None listed | {{- if eq $moduleType "resource" }}❌ None listed | {{- end }}❌ None listed | ❌ None listed |
| No. | Module Name | Source Code |
Display Name | {{- if eq $moduleType "resource" }}CAF Abbreviation | {{- end }}Status & Versions | Primary Owner |
|---|---|---|---|---|---|---|
| {{/* row index */}} {{- printf "%02d" $i -}} {{- $i = add $i 1 -}} | {{/* module name and link to the registry */}} {{- if $useLinks -}} {{- if or (eq $item.ModuleStatus "Available") (eq $item.ModuleStatus "Orphaned") (eq $item.ModuleStatus "Deprecated") -}} {{ $item.ModuleName }} {{- else -}} {{ $item.ModuleName }} {{- end -}} {{- else -}} {{ $item.ModuleName }} {{- end -}} {{- partial "render-terraform-submodules.html" (dict "moduleName" $item.ModuleName "repoURL" $item.RepoURL "moduleStatus" $item.ModuleStatus "useLinks" $useLinks) -}} | {{/* link to the source code repo */}} {{- if $useLinks -}} {{- if or (eq $item.ModuleStatus "Available") (eq $item.ModuleStatus "Orphaned") (eq $item.ModuleStatus "Deprecated") -}} 📄 {{- else -}} {{ "n/a" }} {{- end -}} {{- else -}} {{ "n/a" }} {{- end -}} | {{/* display name and alternative names */}}
{{- with $trimmedAlternativeNames -}}
{{ $item.ModuleDisplayName }}
{{ $trimmedAlternativeNames }} {{- else -}} {{ $item.ModuleDisplayName }} {{- end -}} |
{{- if eq $moduleType "resource" -}}
{{/* CAF recommended abbreviation(s) */}} {{- $cafNs := lower (printf "%s/%s" $item.ProviderNamespace $item.ResourceType) -}} {{- partial "caf-abbreviation.html" (dict "rows" $cafRows "ns" $cafNs) -}} | {{- end -}} {{/* availability badge and versions */}}
{{- if or (eq $item.ModuleStatus "Available") (eq $item.ModuleStatus "Orphaned") (eq $item.ModuleStatus "Deprecated") -}}
{{/* Replace single hyphens with double hyphens for correct badge rendering for pre-releases - e.g., 0.2.0-pre1 */}}
{{- $badgeVersion := replace $moduleLatestVersion "-" "--" -}}
|
{{/* module owners */}}
{{- if ne $item.PrimaryModuleOwnerGHHandle "" -}}
{{ $item.PrimaryModuleOwnerGHHandle }}
{{- if and (ne $item.PrimaryModuleOwnerGHHandle "") (ne $item.PrimaryModuleOwnerDisplayName "") -}}
{{ $item.PrimaryModuleOwnerDisplayName }} {{- end -}} {{- end -}} {{- if ne $item.SecondaryModuleOwnerGHHandle "" -}} {{ $item.SecondaryModuleOwnerGHHandle }} {{- if and (ne $item.SecondaryModuleOwnerGHHandle "") (ne $item.SecondaryModuleOwnerDisplayName "") -}} {{ $item.SecondaryModuleOwnerDisplayName }} {{- end -}} {{- end -}} |
{{- end -}}
| {{ printf "%02d" $i }}{{ $i = add $i 1 }} | ❌ None listed | ❌ None listed | ❌ None listed | {{- if eq $moduleType "resource" }}❌ None listed | {{- end }}❌ None listed | ❌ None listed |