Skip to content

Commit

Permalink
Add support for azurerm_function_app (and misc. housekeeping) (Azure#36)
Browse files Browse the repository at this point in the history
* 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 Azure#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.
  • Loading branch information
travisty- authored Oct 1, 2020
1 parent e75a386 commit c8d9a3e
Show file tree
Hide file tree
Showing 7 changed files with 3,089 additions and 3,053 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit c8d9a3e

Please sign in to comment.