Skip to content

Commit

Permalink
Add screencast
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx committed Feb 18, 2022
1 parent 8de53e2 commit 1bdc4f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
6 changes: 5 additions & 1 deletion docs/guides/experimental-exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ Generates `*.tf` files for Databricks resources as well as `import.sh` to run im

## Example Usage

After downloading the [latest released binary](https://github.com/databrickslabs/terraform-provider-databricks/releases), unpack it and place it in the same folder. In fact, you may have already downloaded this binary - check `.terraform` folder of any state directory, where you've used `databricks` provider. It could also be in your plugin cache `~/.terraform.d/plugins/registry.terraform.io/databrickslabs/databricks/*/*/terraform-provider-databricks`.
After downloading the [latest released binary](https://github.com/databrickslabs/terraform-provider-databricks/releases), unpack it and place it in the same folder. In fact, you may have already downloaded this binary - check `.terraform` folder of any state directory, where you've used `databricks` provider. It could also be in your plugin cache `~/.terraform.d/plugins/registry.terraform.io/databrickslabs/databricks/*/*/terraform-provider-databricks`. Here's the tool in action:

[![asciicast](https://asciinema.org/a/Rv8ZFJQpfrfp6ggWddjtyXaOy.svg)](https://asciinema.org/a/Rv8ZFJQpfrfp6ggWddjtyXaOy)

Exporter can also be used in a non-interactive mode:

```bash
export DATABRICKS_HOST=...
Expand Down
23 changes: 0 additions & 23 deletions exporter/importables.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,29 +790,6 @@ var resourcesMap map[string]importable = map[string]importable{
return nil
},
},
"databricks_git_credential": {
Service: "repos",
Name: func(d *schema.ResourceData) string {
return d.Get("git_provider").(string) + "_" + d.Get("git_username").(string) + "_" + d.Id()
},
List: func(ic *importContext) error {
creds, err := repos.NewGitCredentialsAPI(ic.Context, ic.Client).List()
if err != nil {
return err
}
for offset, cred := range creds {
ic.Emit(&resource{
Resource: "databricks_git_credential",
ID: fmt.Sprintf("%d", cred.ID),
})
log.Printf("[INFO] Scanned %d of %d Git credentials", offset+1, len(creds))
}
return nil
},
Depends: []reference{
{Path: "personal_access_token", Variable: true},
},
},
"databricks_workspace_conf": {
Service: "workspace",
Name: func(d *schema.ResourceData) string {
Expand Down
26 changes: 0 additions & 26 deletions exporter/importables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,32 +606,6 @@ func TestNotebookGeneration(t *testing.T) {
})
}

func TestGitCredentialGen(t *testing.T) {
testGenerate(t, []qa.HTTPFixture{
{
Method: "GET",
Resource: "/api/2.0/git-credentials/a",
Response: repos.GitCredentialResponse{
UserName: "me",
Provider: "github",
},
},
}, "repos", func(ic *importContext) {
ic.Emit(&resource{
Resource: "databricks_git_credential",
ID: "a",
})

ic.generateHclForResources(nil)
assert.Equal(t, internal.TrimLeadingWhitespace(`
resource "databricks_git_credential" "github_me_a" {
personal_access_token = var.personal_access_token_github_me_a
git_username = "me"
git_provider = "github"
}`), string(ic.Files["repos"].Bytes()))
})
}

func TestGlobalInitScriptGen(t *testing.T) {
testGenerate(t, []qa.HTTPFixture{
{
Expand Down

0 comments on commit 1bdc4f1

Please sign in to comment.