Skip to content

Commit

Permalink
Support azuread provider
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo committed Dec 4, 2024
1 parent db6d30c commit 8d0c5fe
Show file tree
Hide file tree
Showing 6 changed files with 7,525 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .tools/schema-generator/azuread/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package main

import (
"encoding/json"
"fmt"
"os"

"github.com/hashicorp/terraform-provider-azuread/internal/provider"
tfschema "github.com/magodo/tfadd/schema"
"github.com/magodo/tfpluginschema"
)

func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

func run() error {
provider := provider.AzureADProvider()
rschs := map[string]*tfschema.Schema{}
for name, rs := range provider.ResourcesMap {
rschs[name] = &tfschema.Schema{Block: tfpluginschema.FromSDKv2SchemaMap(rs.Schema)}
}
dschs := map[string]*tfschema.Schema{}
for name, ds := range provider.DataSourcesMap {
dschs[name] = &tfschema.Schema{Block: tfpluginschema.FromSDKv2SchemaMap(ds.Schema)}
}
b, err := json.MarshalIndent(tfschema.ProviderSchema{ResourceSchemas: rschs, DatasourceSchemas: dschs}, "", " ")
if err != nil {
return err
}
fmt.Println(string(b))
return nil
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Currently to generate the state, the tool supports *full mode* (with `-full`) or
|-|-|
|hashicorp/aws|v5.64.0|
|hashicorp/azurerm|v4.5.0|
|hashicorp/azuread|v3.0.2|
|hashicorp/google|v6.0.1|
|azure/azapi|v2.0.1|

Expand Down
Loading

0 comments on commit 8d0c5fe

Please sign in to comment.