@pulumi/databricks 0.0.1-alpha.1650024857 → 0.4.1-alpha.1650932029

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,303 +1,76 @@
1
- # Terraform Bridge Provider Boilerplate
1
+ [![Actions Status](https://github.com/pulumi/pulumi-databricks/workflows/master/badge.svg)](https://github.com/pulumi/pulumi-databricks/actions)
2
+ [![Slack](http://www.pulumi.com/images/docs/badges/slack.svg)](https://slack.pulumi.com)
3
+ [![NPM version](https://badge.fury.io/js/%40pulumi%2Fdatabricks.svg)](https://www.npmjs.com/package/@pulumi/databricks)
4
+ [![Python version](https://badge.fury.io/py/pulumi-databricks.svg)](https://pypi.org/project/pulumi-databricks)
5
+ [![NuGet version](https://badge.fury.io/nu/pulumi.databricks.svg)](https://badge.fury.io/nu/pulumi.databricks)
6
+ [![PkgGoDev](https://pkg.go.dev/badge/github.com/pulumi/pulumi-databricks/sdk/go)](https://pkg.go.dev/github.com/pulumi/pulumi-databricks/sdk/go)
7
+ [![License](https://img.shields.io/npm/l/%40pulumi%2Fpulumi.svg)](https://github.com/pulumi/pulumi-databricks/blob/master/LICENSE)
2
8
 
3
- This repository contains boilerplate code for building a new Pulumi provider which wraps an existing Terraform provider. These instructions are primarily intended for internal use by Pulumi as we have not yet refined the process for general consumption by the community at large, but this document may serve as a rough guide for community members who want to create their own Pulumi providers that wrap an existing Terraform provider.
9
+ # Databricks Resource Provider
4
10
 
5
- ## Creating a Pulumi Terraform Bridge Provider
11
+ The Databricks Resource Provider lets you manage Databricks resources.
6
12
 
7
- The following instructions assume a Pulumi-owned provider based on an upstream provider named `terraform-provider-foo`. Substitute appropriate values below for your use case.
13
+ ## Installing
8
14
 
9
- > Note: If the name of the desired Pulumi provider differs from the name of the Terraform provider, you will need to carefully distinguish between the references - see <https://github.com/pulumi/pulumi-azure> for an example.
15
+ This package is available in many languages in the standard packaging formats.
10
16
 
11
- ### Prerequisites
17
+ ### Node.js (Java/TypeScript)
12
18
 
13
- Ensure the following tools are installed and present in your `$PATH`:
19
+ To use from JavaScript or TypeScript in Node.js, install using either `npm`:
14
20
 
15
- * [`pulumictl`](https://github.com/pulumi/pulumictl#installation)
16
- * [Go 1.16](https://golang.org/dl/) or 1.latest
17
- * [NodeJS](https://nodejs.org/en/) 14.x. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS installations.
18
- * [Yarn](https://yarnpkg.com/)
19
- * [TypeScript](https://www.typescriptlang.org/)
20
- * [Python](https://www.python.org/downloads/) (called as `python3`). For recent versions of MacOS, the system-installed version is fine.
21
- * [.NET](https://dotnet.microsoft.com/download)
21
+ $ npm install @pulumi/databricks
22
22
 
23
- ### Creating and Initializing the Repository
23
+ or `yarn`:
24
24
 
25
- Pulumi offers this repository as a [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for convenience. From this repository:
25
+ $ yarn add @pulumi/databricks
26
26
 
27
- 1. Click "Use this template".
28
- 1. Set the following options:
29
- * Owner: pulumi (or your GitHub organization/username)
30
- * Repository name: pulumi-foo
31
- * Description: Pulumi provider for Foo
32
- * Repository type: Public
33
- 1. Clone the generated repository.
27
+ ### Python
34
28
 
35
- From the templated repository:
29
+ To use from Python, install using `pip`:
36
30
 
37
- 1. Run the following command to update files to use the name of your provider:
31
+ $ pip install pulumi_databricks
38
32
 
39
- ```bash
40
- make prepare NAME=foo REPOSITORY=github.com/pulumi/pulumi-foo
41
- ```
33
+ ### Go
42
34
 
43
- 1. Modify `README-PROVIDER.md` to include the following (we'll rename it to `README.md` toward the end of this guide):
44
- * Any desired build status badges.
45
- * An introductory paragraph describing the type of resources the provider manages, e.g. "The Foo provider for Pulumi manages resources for [Foo](http://example.com/).
46
- * In the "Installing" section, correct package names for the various SDK libraries in the languages Pulumi supports.
47
- * In the "Configuration" section, any configurable options for the provider. These may include, but are not limited to, environment variables or options that can be set via [`pulumi config set`](https://www.pulumi.com/docs/reference/cli/pulumi_config_set/).
48
- * In the "Reference" section, provide a link to the to-be-published documentation.
49
- * Feel free to refer to [the Pulumi AWS provider README](https://github.com/pulumi/pulumi-aws) as an example.
35
+ To use from Go, use `go get` to grab the latest version of the library
50
36
 
51
- ### Composing the Provider Code - Prerequisites
37
+ $ go get github.com/pulumi/pulumi-databricks/sdk
52
38
 
53
- Pulumi provider repositories have the following general structure:
39
+ ### .NET
54
40
 
55
- * `examples/` contains sample code which may optionally be included as integration tests to be run as part of a CI/CD pipeline.
56
- * `provider/` contains the Go code used to create the provider as well as generate the SDKs in the various languages that Pulumi supports.
57
- * `sdk/` contains the generated SDK code for each of the language platforms that Pulumi supports, with each supported platform in a separate subfolder.
41
+ To use from .NET, install using `dotnet add package`:
58
42
 
59
- 1. In `provider/go.mod`, add a reference to the upstream Terraform provider in the `require` section, e.g.
43
+ $ dotnet add package Pulumi.Databricks
60
44
 
61
- ```go
62
- github.com/foo/terraform-provider-foo v0.4.0
63
- ```
45
+ ## Configuration
64
46
 
65
- 1. In `provider/resources.go`, ensure the reference in the `import` section uses the correct Go module path, e.g.:
47
+ The following configuration points are available:
66
48
 
67
- ```go
68
- github.com/foo/terraform-provider-foo/foo
69
- ```
49
+ * `databricks:host` - (optional) This is the host of the Databricks workspace. It is a URL that you use to login to your workspace.
50
+ Alternatively, you can provide this value as an environment variable `DATABRICKS_HOST`.
51
+ * `databricks:token` - (optional) This is the API token to authenticate into the workspace. Alternatively, you can provide
52
+ this value as an environment variable `DATABRICKS_TOKEN`.
53
+ * `databricks:username` - (optional) This is the username of the user that can log into the workspace. Alternatively,
54
+ you can provide this value as an environment variable `DATABRICKS_USERNAME`.
55
+ * `databricks:password` - (optional) This is the user's password that can log into the workspace. Alternatively, you can
56
+ provide this value as an environment variable `DATABRICKS_PASSWORD`.
57
+ * `databricks:configFile` - (optional) Location of the Databricks CLI credentials file created by `databricks configure --token`
58
+ command (`~/.databrickscfg` by default). Check [Databricks CLI documentation](https://docs.databricks.com/dev-tools/cli/index.html#set-up-authentication) for more details.
59
+ The provider uses configuration file credentials when you don't specify host/token/username/password/azure attributes.
60
+ Alternatively, you can provide this value as an environment variable `DATABRICKS_CONFIG_FILE`. This field defaults to `~/.databrickscfg`.
61
+ * `databricks:profile` - (optional) Connection profile specified within `~/.databrickscfg`. Please check
62
+ [connection profiles section](https://docs.databricks.com/dev-tools/cli/index.html#connection-profiles) for more details. This field defaults to `DEFAULT`.
63
+ * `databricks:accountId` - (optional) Account Id that could be found in the bottom left corner of
64
+ [Accounts Console](https://accounts.cloud.databricks.com/). Alternatively, you can provide this value as an environment
65
+ variable `DATABRICKS_ACCOUNT_ID`. Only has effect when `host = "https://accounts.cloud.databricks.com/"` and currently used to provision account admins via `databricks_user`.
66
+ In the future releases of the provider this property will also be used specify account for `databricks_mws_*` resources as well.
67
+ * `databricks:authType` - (optional) enforce specific auth type to be used in very rare cases, where a single provider state
68
+ manages Databricks workspaces on more than one cloud and `More than one authorization method configured` error is a false positive. Valid values are `pat`, `basic`, `azure-client-secret`, `azure-msi`, `azure-cli`, and `databricks-cli`.
70
69
 
71
- 1. Download the dependencies:
70
+ ## Reference
72
71
 
73
- ```bash
74
- cd provider && go mod tidy && cd -
75
- ```
72
+ For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/databricks/api-docs/).
76
73
 
77
- 1. Validate the schema by running the following command:
74
+ ## Contributors
78
75
 
79
- ```bash
80
- make tfgen
81
- ```
82
-
83
- Note warnings about unmapped resources and data sources in the command's output. We map these in the next section, e.g.:
84
-
85
- ```text
86
- warning: resource foo_something not found in provider map; skipping
87
- warning: resource foo_something_else not found in provider map; skipping
88
- warning: data source foo_something not found in provider map; skipping
89
- warning: data source foo_something_else not found in provider map; skipping
90
- ```
91
-
92
- ## Adding Mappings, Building the Provider and SDKs
93
-
94
- In this section we will add the mappings that allow the interoperation between the Pulumi provider and the Terraform provider. Terraform resources map to an identically named concept in Pulumi. Terraform data sources map to plain old functions in your supported programming language of choice. Pulumi also allows provider functions and resources to be grouped into _namespaces_ to improve the cohesion of a provider's code, thereby making it easier for developers to use. If your provider has a large number of resources, consider using namespaces to improve usability.
95
-
96
- The following instructions all pertain to `provider/resources.go`, in the section of the code where we construct a `tfbridge.ProviderInfo` object:
97
-
98
- 1. **Add resource mappings:** For each resource in the provider, add an entry in the `Resources` property of the `tfbridge.ProviderInfo`, e.g.:
99
-
100
- ```go
101
- // Most providers will have all resources (and data sources) in the main module.
102
- // Note the mapping from snake_case HCL naming conventions to UpperCamelCase Pulumi SDK naming conventions.
103
- // The name of the provider is omitted from the mapped name due to the presence of namespaces in all supported Pulumi languages.
104
- "foo_something": {Tok: tfbridge.MakeResource(mainPkg, mainMod, "Something")},
105
- "foo_something_else": {Tok: tfbridge.MakeResource(mainPkg, mainMod, "SomethingElse")},
106
- ```
107
-
108
- 1. **Add CSharpName (if necessary):** Dotnet does not allow for fields named the same as the enclosing type, which sometimes results in errors during the dotnet SDK build.
109
- If you see something like
110
- ```text
111
- error CS0542: 'ApiKey': member names cannot be the same as their enclosing type [/Users/guin/go/src/github.com/pulumi/pulumi-artifactory/sdk/dotnet/Pulumi.Artifactory.csproj]
112
- ```
113
- you'll want to give your Resource a CSharpName, which can have any value that makes sense:
114
-
115
- ```go
116
- "foo_something_dotnet": {
117
- Tok: tfbridge.MakeResource(mainPkg, mainMod, "SomethingDotnet"),
118
- Fields: map[string]*tfbridge.SchemaInfo{
119
- "something_dotnet": {
120
- CSharpName: "SpecialName",
121
- },
122
- },
123
- },
124
- ```
125
-
126
- [See the underlying terraform-bridge code here.](https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/info.go#L168)
127
- 1. **Add data source mappings:** For each data source in the provider, add an entry in the `DataSources` property of the `tfbridge.ProviderInfo`, e.g.:
128
-
129
- ```go
130
- // Note the 'get' prefix for data sources
131
- "foo_something": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "getSomething")},
132
- "foo_something_else": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "getSomethingElse")},
133
- ```
134
-
135
- 1. **Add documentation mapping (sometimes needed):** If the upstream provider's repo is not a part of the `terraform-providers` GitHub organization, specify the `GitHubOrg` property of `tfbridge.ProviderInfo` to ensure that documentation is picked up by the codegen process, and that attribution for the upstream provider is correct, e.g.:
136
-
137
- ```go
138
- GitHubOrg: "foo",
139
- ```
140
-
141
- 1. **Add provider configuration overrides (not typically needed):** Pulumi's Terraform bridge automatically detects configuration options for the upstream provider. However, in rare cases these settings may need to be overridden, e.g. if we want to change an environment variable default from `API_KEY` to `FOO_API_KEY`. Examples of common uses cases:
142
-
143
- ```go
144
- "additional_required_parameter": {},
145
- "additional_optional_string_parameter": {
146
- Default: &tfbridge.DefaultInfo{
147
- Value: "default_value",
148
- },
149
- "additional_optional_boolean_parameter": {
150
- Default: &tfbridge.DefaultInfo{
151
- Value: true,
152
- },
153
- // Renamed environment variables can be accounted for like so:
154
- "apikey": {
155
- Default: &tfbridge.DefaultInfo{
156
- EnvVars: []string{"FOO_API_KEY"},
157
- },
158
- ```
159
-
160
- 1. Build the provider and ensure there are no warnings about unmapped resources and no warnings about unmapped data sources:
161
-
162
- ```bash
163
- make provider
164
- ```
165
-
166
- You may see warnings about documentation and examples, including "unexpected code snippets". These can be safely ignored for now. Pulumi will add additional documentation on mapping docs in a future revision of this guide.
167
-
168
- 1. Build the SDKs in the various languages Pulumi supports:
169
-
170
- ```bash
171
- make build_sdks
172
- ```
173
-
174
- 1. Ensure the Golang SDK is a proper go module:
175
-
176
- ```bash
177
- cd sdk && go mod tidy && cd -
178
- ```
179
-
180
- This will pull in the correct dependencies in `sdk/go.mod` as well as setting the dependency tree in `sdk/go.sum`.
181
-
182
- 1. Finally, ensure the provider code conforms to Go standards:
183
-
184
- ```bash
185
- make lint_provider
186
- ```
187
-
188
- Fix any issues found by the linter.
189
-
190
- **Note:** If you make revisions to code in `resources.go`, you must re-run the `make tfgen` target to regenerate the schema. Pulumi providers use Go 1.16, which does not have the ability to directly embed text files. The `make tfgen` target will take the file `schema.json` and serialize it to a byte array so that it can be included in the build output. (Go 1.17 will remove the need for this step.)
191
-
192
- ## Sample Program
193
-
194
- In this section, we will create a Pulumi program in TypeScript that utilizes the provider we created to ensure everything is working properly.
195
-
196
- 1. Create an account with the provider's service and generate any necessary credentials, e.g. API keys:
197
- * Email: bot@pulumi.com
198
- * Password: (Create a random password in 1Password with the maximum length and complexity allowed by the provider.)
199
- * Ensure all secrets (passwords, generated API keys) are stored in Pulumi's 1Password vault.
200
-
201
- 1. Copy the `pulumi-resource-foo` binary generated by `make provider` and place it in your `$PATH` (`$GOPATH/bin` is a convenient choice), e.g.:
202
-
203
- ```bash
204
- cp bin/pulumi-resource-foo $GOPATH/bin
205
- ```
206
-
207
- 1. Tell Yarn to use your local copy of the SDK:
208
-
209
- ```bash
210
- make install_nodejs_sdk
211
- ```
212
-
213
- 1. Create a new Pulumi program in the `examples/` directory, e.g.:
214
-
215
- ```bash
216
- mkdir examples/my-example/ts # Change "my-example" to something more meaningful.
217
- cd examples/my-example/ts
218
- pulumi new typescript
219
- # (Go through the prompts with the default values)
220
- npm install
221
- yarn link @pulumi/foo
222
- ```
223
-
224
- 1. Create a minimal program for the provider, i.e. one that creates the smallest-footprint resource. Place this code in `index.ts`.
225
- 1. Configure any necessary environment variables for authentication, e.g `$FOO_USERNAME`, `$FOO_TOKEN`, in your local environment.
226
- 1. Ensure the program runs successfully via `pulumi up`.
227
- 1. Once the program completes successfully, verify the resource was created in the provider's UI.
228
- 1. Destroy any resources created by the program via `pulumi destroy`.
229
-
230
- Optionally, you may create additional examples for SDKs in other languages supported by Pulumi:
231
-
232
- 1. Python:
233
-
234
- ```bash
235
- mkdir examples/my-example/py
236
- cd examples/my-example/py
237
- pulumi new python
238
- # (Go through the prompts with the default values)
239
- source venv/bin/activate # use the virtual Python env that Pulumi sets up for you
240
- pip install pulumi_foo
241
- ```
242
-
243
- 1. Follow the steps above to verify the program runs successfully.
244
-
245
- ## Add End-to-end Testing
246
-
247
- We can run integration tests on our examples using the `*_test.go` files in the `examples/` folder.
248
-
249
- 1. Add code to `examples_nodejs_test.go` to call the example you created, e.g.:
250
-
251
- ```go
252
- // Swap out MyExample and "my-example" below with the name of your integration test.
253
- func TestAccMyExampleTs(t *testing.T) {
254
- test := getJSBaseOptions(t).
255
- With(integration.ProgramTestOptions{
256
- Dir: filepath.Join(getCwd(t), "my-example", "ts"),
257
- })
258
- integration.ProgramTest(t, &test)
259
- }
260
- ```
261
-
262
- 1. Add a similar function for each example that you want to run in an integration test. For examples written in other languages, create similar files for `examples_${LANGUAGE}_test.go`.
263
-
264
- 1. You can run these tests locally via Make:
265
-
266
- ```bash
267
- make test
268
- ```
269
-
270
- You can also run each test file separately via test tags:
271
-
272
- ```bash
273
- cd examples && go test -v -tags=nodejs
274
- ```
275
-
276
- ## Configuring CI with GitHub Actions
277
-
278
- In this section, we'll add the necessary configuration to work with GitHub Actions for Pulumi's standard CI/CD workflows for providers.
279
-
280
- 1. Generate GitHub workflows per [the instructions in the ci-mgmt repository](https://github.com/pulumi/ci-mgmt/) and copy to `.github/` in this repository.
281
-
282
- 1. Ensure that any required secrets are present as repository-level [secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in GitHub. These will be used by the integration tests during the CI/CD process.
283
-
284
- 1. Repository settings: Toggle `Allow auto-merge` on in your provider repo to automate GitHub Actions workflow updates.
285
-
286
- ## Final Steps
287
-
288
- 1. Ensure all required configurations (API keys, etc.) are documented in README-PROVIDER.md.
289
-
290
- 1. Replace this file with the README for the provider and push your changes:
291
-
292
- ```bash
293
- mv README-PROVIDER.md README.md
294
- ```
295
-
296
- 1. If publishing the npm package fails during the "Publish SKDs" Action, perform the following steps:
297
- 1. Go to [NPM Packages](https://www.npmjs.com/) and sign in as pulumi-bot.
298
- 1. Click on the bot's profile pic and navigate to "Packages".
299
- 1. On the left, under "Organizations, click on the Pulumi organization.
300
- 1. On the last page of the listed packages, you should see the new package.
301
- 1. Under "Settings", set the Package Status to "public".
302
-
303
- Now you are ready to use the provider, cut releases, and have some well-deserved :ice_cream:!
76
+ This package was originally built by the development team at [https://www.ingenii.io/](https://www.ingenii.io/). Pulumi thanks them for their continued contributions to the project.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/databricks",
3
- "version": "v0.0.1-alpha.1650024857+53a099fe",
3
+ "version": "v0.4.1-alpha.1650932029+43580d4a",
4
4
  "description": "A Pulumi package for creating and managing databricks cloud resources.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -12,7 +12,7 @@
12
12
  "license": "Apache-2.0",
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "install": "node scripts/install-pulumi-plugin.js resource databricks v0.0.1-alpha.1650024857+53a099fe"
15
+ "install": "node scripts/install-pulumi-plugin.js resource databricks v0.4.1-alpha.1650932029+43580d4a"
16
16
  },
17
17
  "dependencies": {
18
18
  "@pulumi/pulumi": "^3.0.0"
package/package.json.dev CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/databricks",
3
- "version": "v0.0.1-alpha.1650024857+53a099fe",
3
+ "version": "v0.4.1-alpha.1650932029+43580d4a",
4
4
  "description": "A Pulumi package for creating and managing databricks cloud resources.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -12,7 +12,7 @@
12
12
  "license": "Apache-2.0",
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "install": "node scripts/install-pulumi-plugin.js resource databricks v0.0.1-alpha.1650024857+53a099fe"
15
+ "install": "node scripts/install-pulumi-plugin.js resource databricks v0.4.1-alpha.1650932029+43580d4a"
16
16
  },
17
17
  "dependencies": {
18
18
  "@pulumi/pulumi": "^3.0.0"