Skip to content

Commit

Permalink
toolins: adding a generator for Resource ID Formatters and Parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Nov 24, 2020
1 parent dd720e7 commit 84a7acf
Show file tree
Hide file tree
Showing 3 changed files with 511 additions and 0 deletions.
1 change: 1 addition & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ terrafmt:
@find . | egrep html.markdown | sort | while read f; do terrafmt fmt $$f; done

generate:
go generate ./azurerm/internal/services/...
go generate ./azurerm/internal/provider/

goimports:
Expand Down
26 changes: 26 additions & 0 deletions azurerm/internal/tools/generator-resource-id/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Generator: Resource ID

Each Service Definition contains one or more Resource ID's - this tool allows the generation of:

* Resource ID Formatters
* Resource ID Parsers
* Resource ID Structs

This is run via go:generate whenever the provider is compiled - at this time this doesn't wipe an existing "parse" folder so it's possible to mix and match if necessary.

## Example Usage

```
go run main.go -path=-path=./ -name=MyResourceType -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.AnalysisServices/servers/Server1
```

## Arguments

* `help` - Show help?

* `id` - An example of the Azure Resource ID for this Resource.

* `name` - The name of this Resource Type, without the Service Name. For example `AnalysisServicesServer` becomes `Server`.

* `path` - The Relative Path to the Service Package.

Loading

0 comments on commit 84a7acf

Please sign in to comment.