Add support for azurerm_function_app (and misc. housekeeping) (#36)
* Add support for azurerm_function_app Adds support for the azurerm_function_app resource type. * Fix resources with inconsistent naming conventions Fixes the naming convention used in the bot_channel_email and container_group resources, converting them to lower_snake_case. * Fix resource template formatting Fixes the resource template formatting to align with the output of terraform fmt, so the files don't have to be formatted afterward. Also noticed a diff between the provider in the template and the Terraform files, so I merged in pull request #35 to fix. * Sort all resources alphabetically Sorts the resource definitions in both JSON documents alphabetically, and updates the build script to alphabetize the output Terraform files.
This commit is contained in:
Родитель
e75a38690c
Коммит
c8d9a3edb2
|
@ -130,7 +130,7 @@ postgresql_server = {
|
|||
| batch\_application | n/a |
|
||||
| batch\_certificate | n/a |
|
||||
| batch\_pool | n/a |
|
||||
| bot\_channel\_Email | n/a |
|
||||
| bot\_channel\_email | n/a |
|
||||
| bot\_channel\_directline | n/a |
|
||||
| bot\_channel\_ms\_teams | n/a |
|
||||
| bot\_channel\_slack | n/a |
|
||||
|
@ -140,7 +140,7 @@ postgresql_server = {
|
|||
| cdn\_endpoint | n/a |
|
||||
| cdn\_profile | n/a |
|
||||
| cognitive\_account | n/a |
|
||||
| containerGroups | n/a |
|
||||
| container\_group | n/a |
|
||||
| container\_registry | n/a |
|
||||
| container\_registry\_webhook | n/a |
|
||||
| cosmosdb\_account | n/a |
|
||||
|
@ -200,6 +200,7 @@ postgresql_server = {
|
|||
| firewall\_network\_rule\_collection | n/a |
|
||||
| frontdoor | n/a |
|
||||
| frontdoor\_firewall\_policy | n/a |
|
||||
| function\_app | n/a |
|
||||
| hdinsight\_hadoop\_cluster | n/a |
|
||||
| hdinsight\_hbase\_cluster | n/a |
|
||||
| hdinsight\_interactive\_query\_cluster | n/a |
|
||||
|
|
8
main.go
8
main.go
|
@ -6,10 +6,11 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"sort"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// Resource definityion for the package
|
||||
// Resource definition for the package
|
||||
type Resource struct {
|
||||
Name string `json:"name"`
|
||||
Length *Length `json:"length,omitempty"`
|
||||
|
@ -67,6 +68,11 @@ func main() {
|
|||
}
|
||||
data = append(data, dataUndocumented...)
|
||||
|
||||
// Sort the documented and undocumented resources alphabetically
|
||||
sort.Slice(data, func(i, j int) bool {
|
||||
return data[i].Name < data[j].Name
|
||||
})
|
||||
|
||||
mainFile, err := os.OpenFile("main.tf", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
3748
main.tf
3748
main.tf
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
1228
outputs.tf
1228
outputs.tf
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,68 +1,35 @@
|
|||
[
|
||||
{
|
||||
"name": "private_endpoint",
|
||||
"name": "databricks_cluster",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pe",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_service_connection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "psc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_ip_configuration",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "fwipconf",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_application_rule_collection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "fwapp",
|
||||
"slug": "dbc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_nat_rule_collection",
|
||||
"name": "databricks_high_concurrency_cluster",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "fwnatrc",
|
||||
"slug": "dbhcc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_network_rule_collection",
|
||||
"name": "databricks_standard_cluster",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "fwnetrc",
|
||||
"slug": "dbsc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
|
@ -153,6 +120,61 @@
|
|||
"slug": "dnsrec",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_application_rule_collection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "parent",
|
||||
"slug": "fwapp",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_ip_configuration",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "fwipconf",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_nat_rule_collection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "parent",
|
||||
"slug": "fwnatrc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "firewall_network_rule_collection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "parent",
|
||||
"slug": "fwnetrc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "network_ddos_protection_plan",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "parent",
|
||||
"slug": "ddospp",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_dns_a_record",
|
||||
"length": {
|
||||
|
@ -230,6 +252,61 @@
|
|||
"slug": "pdnsrec",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_dns_zone_group",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pdnszg",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_endpoint",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pe",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_link_service",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pls",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_service_connection",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "psc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "proximity_placement_group",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "ppg",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "virtual_machine_extension",
|
||||
"length": {
|
||||
|
@ -251,82 +328,5 @@
|
|||
"scope": "parent",
|
||||
"slug": "vmssx",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "network_ddos_protection_plan",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "parent",
|
||||
"slug": "ddospp",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_dns_zone_group",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pdnszg",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "proximity_placement_group",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "ppg",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "private_link_service",
|
||||
"length": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
|
||||
"scope": "resourceGroup",
|
||||
"slug": "pls",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "databricks_cluster",
|
||||
"length": {
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "dbc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "databricks_standard_cluster",
|
||||
"length": {
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "dbsc",
|
||||
"dashes": true
|
||||
},
|
||||
{
|
||||
"name": "databricks_high_concurrency_cluster",
|
||||
"length": {
|
||||
"min": 3,
|
||||
"max": 30
|
||||
},
|
||||
"regex": "^(?=.{3,30}$)[a-zA-Z0-9-_]+$",
|
||||
"scope": "parent",
|
||||
"slug": "dbhcc",
|
||||
"dashes": true
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{{- define "resources" -}}
|
||||
{{- .Name }} = {
|
||||
name = substr(join("{{if .Dashes}}-{{ end }}", compact([local.prefix{{if not .Dashes}}_safe{{ end }}, "{{ .Slug }}", local.suffix{{if not .Dashes}}_safe{{ end }}])), 0, {{ .Length.Max }})
|
||||
name_unique = substr(join("{{if .Dashes}}-{{ end }}", compact([local.prefix{{if not .Dashes}}_safe{{ end }}, "{{ .Slug }}", local.suffix_unique{{if not .Dashes}}_safe{{ end }}])), 0, {{ .Length.Max }})
|
||||
dashes = {{ .Dashes }}
|
||||
slug = "{{ .Slug }}"
|
||||
min_length = {{ .Length.Min }}
|
||||
max_length = {{ .Length.Max }}
|
||||
scope = "{{ .Scope }}"
|
||||
regex = "{{ cleanRegex .Regex }}"
|
||||
name = substr(join("{{if .Dashes}}-{{ end }}", compact([local.prefix{{if not .Dashes}}_safe{{ end }}, "{{ .Slug }}", local.suffix{{if not .Dashes}}_safe{{ end }}])), 0, {{ .Length.Max }})
|
||||
name_unique = substr(join("{{if .Dashes}}-{{ end }}", compact([local.prefix{{if not .Dashes}}_safe{{ end }}, "{{ .Slug }}", local.suffix_unique{{if not .Dashes}}_safe{{ end }}])), 0, {{ .Length.Max }})
|
||||
dashes = {{ .Dashes }}
|
||||
slug = "{{ .Slug }}"
|
||||
min_length = {{ .Length.Min }}
|
||||
max_length = {{ .Length.Max }}
|
||||
scope = "{{ .Scope }}"
|
||||
regex = "{{ cleanRegex .Regex }}"
|
||||
}
|
||||
{{- end -}}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче