diff --git a/internal/cli/terraform.go b/internal/cli/terraform.go index 9f71b661d..7e556be2d 100644 --- a/internal/cli/terraform.go +++ b/internal/cli/terraform.go @@ -64,7 +64,7 @@ func (i *terraformInputs) parseResourceFetchers(api *auth0.API) ([]resourceDataF fetchers = append(fetchers, &attackProtectionResourceFetcher{}) case "auth0_branding": fetchers = append(fetchers, &brandingResourceFetcher{}) - case "auth0_client": + case "auth0_client", "auth0_client_credentials": fetchers = append(fetchers, &clientResourceFetcher{api}) case "auth0_client_grant": fetchers = append(fetchers, &clientGrantResourceFetcher{api}) diff --git a/internal/cli/terraform_fetcher.go b/internal/cli/terraform_fetcher.go index 94a2e3839..5356f3692 100644 --- a/internal/cli/terraform_fetcher.go +++ b/internal/cli/terraform_fetcher.go @@ -122,6 +122,11 @@ func (f *clientResourceFetcher) FetchData(ctx context.Context) (importDataList, ResourceName: "auth0_client." + sanitizeResourceName(client.GetName()), ImportID: client.GetClientID(), }) + + data = append(data, importDataItem{ + ResourceName: "auth0_client_credentials." + sanitizeResourceName(client.GetName()), + ImportID: client.GetClientID(), + }) } if !clients.HasNext() { diff --git a/internal/cli/terraform_fetcher_test.go b/internal/cli/terraform_fetcher_test.go index d751cd946..ca264ad81 100644 --- a/internal/cli/terraform_fetcher_test.go +++ b/internal/cli/terraform_fetcher_test.go @@ -202,18 +202,34 @@ func TestClientResourceFetcher_FetchData(t *testing.T) { ResourceName: "auth0_client.my_test_client_1", ImportID: "clientID_1", }, + { + ResourceName: "auth0_client_credentials.my_test_client_1", + ImportID: "clientID_1", + }, { ResourceName: "auth0_client.my_test_client_2", ImportID: "clientID_2", }, + { + ResourceName: "auth0_client_credentials.my_test_client_2", + ImportID: "clientID_2", + }, { ResourceName: "auth0_client.my_test_client_3", ImportID: "clientID_3", }, + { + ResourceName: "auth0_client_credentials.my_test_client_3", + ImportID: "clientID_3", + }, { ResourceName: "auth0_client.my_test_client_4", ImportID: "clientID_4", }, + { + ResourceName: "auth0_client_credentials.my_test_client_4", + ImportID: "clientID_4", + }, } data, err := fetcher.FetchData(context.Background())