-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add databricks_app
resource
#4099
Merged
Merged
Changes from all commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
c8859e2
added `databricks_app` resource
nkvuong 962d9f2
wip
nkvuong 2e9137a
add doc
nkvuong 91b5166
alias
nkvuong bcf2a97
Merge branch 'main' into feature/app
nkvuong 35b85eb
fix
nkvuong 9c7ad60
fix test
nkvuong 863fa37
fix test
nkvuong 2d7b38c
fix
nkvuong b733ee9
Merge branch 'main' into feature/app
nkvuong ff8bee8
feedback
nkvuong 0daeea1
fix test
nkvuong 7449b45
Merge branch 'main' into feature/app
nkvuong eda8a91
feedback
nkvuong f254176
feedback
nkvuong 18b3520
Merge branch 'main' into feature/app
nkvuong be96f91
feedback
nkvuong 8338d09
add app permission
nkvuong c6ee7ea
Merge branch 'main' into feature/app
nkvuong 07ea8b7
fix test
nkvuong 3b1f6e2
Merge branch 'feature/app' of https://github.com/databricks/terraform…
nkvuong 9e41c69
more computed fields
nkvuong 0ad4294
feedback
nkvuong 8bdcda9
fix test
nkvuong 2bac7aa
feedback
nkvuong 17e1923
work
mgyucht 731469e
Remove unused configuration from blocks
mgyucht 7dd91f4
add test
mgyucht 14fea49
fix
mgyucht 6bd77aa
Add ConvertToAttribute() support
mgyucht 25ae4ba
small typos
mgyucht 7ba55dd
Merge branch 'main' into add-convert-to-attribute
mgyucht a62a65f
Merge branch 'main' into feature/app
mgyucht 08d4111
Merge branch 'add-convert-to-attribute' into feature/app
mgyucht 1628cb8
work
mgyucht e30e677
wip first commit
mgyucht b9f8e65
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht 6e44632
maybe
mgyucht 29d73dd
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht ff11182
fixes
mgyucht 8af1c31
works
mgyucht dac1bab
Merge branch 'main' into use-tftypes-everywhere
mgyucht c4c9375
work
mgyucht 3e26f55
some work
mgyucht 7336447
working
mgyucht cfdec91
more work
mgyucht 4b36d53
fix
mgyucht 93763a8
more work
mgyucht 37d3f1b
work
mgyucht 3b5015b
go mod tidy
mgyucht 123432c
comment
mgyucht b84854a
cleanup
mgyucht 6222b90
add coverage for object types
mgyucht 295c972
more comments
mgyucht 6a39e1b
more comments
mgyucht e4aff40
clean up resource_sahre
mgyucht c5a1181
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht 2c3ed47
fix
mgyucht 5b52d77
fix
mgyucht edc1d4c
work
mgyucht 30398da
it passes a test
mgyucht 560ce27
work
mgyucht 687996c
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht 5779ece
works again
mgyucht b3634bd
work
mgyucht 32cba97
fix
mgyucht 4fdd72b
work
mgyucht 0619e2e
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht a9f12b6
bugfix
mgyucht 2feedf4
improve error message
mgyucht 4feb053
fix go to tf conversion
mgyucht d10447f
fixes
mgyucht ed7246e
fmt
mgyucht 0d49760
fix types.Object handling
mgyucht a0297e6
Merge branch 'use-tftypes-everywhere' into feature/app
mgyucht adb9746
Merge branch 'main' into feature/app
mgyucht 5adec2e
revert sharing change
mgyucht 6496607
remove extra file
mgyucht 285c29f
work
mgyucht ed7b0ec
Panic if the provided path is invalid
mgyucht 853622c
Merge branch 'panic-on-invalid-path' into feature/app
mgyucht 9588149
fix
mgyucht 07a77bc
Expose several integration test helpers for use in plugin framework i…
mgyucht c3ef933
more
mgyucht 5da3a69
Merge branch 'expose-integration-test-helpers' into feature/app
mgyucht ecd7d29
tests
mgyucht f138239
Merge branch 'main' into feature/app
mgyucht b929583
first attempt
mgyucht 5c4a1c7
Merge branch 'use-attributes-by-default' into feature/app
mgyucht ec950fb
fix
mgyucht eaf71eb
work
mgyucht 7f8a845
work
mgyucht d16ec81
fixes
mgyucht 29aa7e9
Merge branch 'readonly-and-list-validators' into use-attributes-by-de…
mgyucht 7c539b8
some work
mgyucht e282b55
work
mgyucht 223acf8
fix formatting
mgyucht 92dbbe9
fix formatting
mgyucht 3ba9694
Merge branch 'main' into use-attributes-by-default
mgyucht 8d42b08
less unnecessary diff
mgyucht f0117c8
work
mgyucht 28c6acc
fix
mgyucht 361cec4
update contributing
mgyucht 402f40a
docs
mgyucht c425508
docs
mgyucht fc9e4c8
tests and better error
mgyucht 10c456e
rename
mgyucht 86b8cce
fix test
mgyucht 5f107cf
Merge branch 'use-attributes-by-default' into feature/app
mgyucht c414f8a
improve integration test
mgyucht a9e438c
Merge branch 'main' into feature/app
mgyucht 66fe1b9
import
mgyucht 59e16d5
add import test
mgyucht e0dd84d
sort
mgyucht 9114ea1
data sources
mgyucht 52e975c
fast app
mgyucht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
subcategory: "Apps" | ||
--- | ||
# databricks_app Data Source | ||
|
||
-> This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html). | ||
|
||
[Databricks Apps](https://docs.databricks.com/en/dev-tools/databricks-apps/index.html) run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on. This resource creates the application but does not handle app deployment, which should be handled separately as part of your CI/CD pipeline. | ||
|
||
This data source allows you to fetch information about a Databricks App. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "databricks_app" "this" { | ||
name = "my-custom-app" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are required: | ||
|
||
* `name` - The name of the app. | ||
|
||
## Attribute Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `app` attribute | ||
* `name` - The name of the app. | ||
* `description` - The description of the app. | ||
* `resources` - A list of resources that the app have access to. | ||
* `compute_status` attribute | ||
* `state` - State of the app compute. | ||
* `message` - Compute status message | ||
* `app_status` attribute | ||
* `state` - State of the application. | ||
* `message` - Application status message | ||
* `url` - The URL of the app once it is deployed. | ||
* `create_time` - The creation time of the app. | ||
* `creator` - The email of the user that created the app. | ||
* `update_time` - The update time of the app. | ||
* `updater` - The email of the user that last updated the app. | ||
* `service_principal_id` - id of the app service principal | ||
* `service_principal_name` - name of the app service principal | ||
* `default_source_code_path` - The default workspace file system path of the source code from which app deployment are created. This field tracks the workspace source code path of the last active deployment. | ||
|
||
### resources Attribute | ||
|
||
This attribute describes a resource used by the app. | ||
|
||
* `name` - The name of the resource. | ||
* `description` - The description of the resource. | ||
|
||
Exactly one of the following attributes will be provided: | ||
|
||
* `secret` attribute | ||
* `scope` - Scope of the secret to grant permission on. | ||
* `key` - Key of the secret to grant permission on. | ||
* `permission` - Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: `READ`, `WRITE`, `MANAGE`. | ||
* `sql_warehouse` attribute | ||
* `id` - Id of the SQL warehouse to grant permission on. | ||
* `permission` - Permission to grant on the SQL warehouse. Supported permissions are: `CAN_MANAGE`, `CAN_USE`, `IS_OWNER`. | ||
* `serving_endpoint` attribute | ||
* `name` - Name of the serving endpoint to grant permission on. | ||
* `permission` - Permission to grant on the serving endpoint. Supported permissions are: `CAN_MANAGE`, `CAN_QUERY`, `CAN_VIEW`. | ||
* `job` attribute | ||
* `id` - Id of the job to grant permission on. | ||
* `permission` - Permissions to grant on the Job. Supported permissions are: `CAN_MANAGE`, `IS_OWNER`, `CAN_MANAGE_RUN`, `CAN_VIEW`. | ||
|
||
## Related Resources | ||
|
||
The following resources are used in the same context: | ||
|
||
* [databricks_app](../resources/app.md) to manage [Databricks Apps](https://docs.databricks.com/en/dev-tools/databricks-apps/index.html). | ||
* [databricks_sql_endpoint](sql_endpoint.md) to manage Databricks SQL [Endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html). | ||
* [databricks_model_serving](model_serving.md) to serve this model on a Databricks serving endpoint. | ||
* [databricks_secret](secret.md) to manage [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace. | ||
* [databricks_job](job.md) to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
subcategory: "Apps" | ||
--- | ||
# databricks_apps Data Source | ||
|
||
-> This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html). | ||
|
||
[Databricks Apps](https://docs.databricks.com/en/dev-tools/databricks-apps/index.html) run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on. This resource creates the application but does not handle app deployment, which should be handled separately as part of your CI/CD pipeline. | ||
|
||
This data source allows you to fetch information about all Databricks Apps within a workspace. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "databricks_apps" "all_apps" {} | ||
``` | ||
|
||
## Attribute Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `apps` - A list of [databricks_app](../resources/app.md) resources. | ||
* `name` - The name of the app. | ||
* `description` - The description of the app. | ||
* `resources` - A list of resources that the app have access to. | ||
* `compute_status` attribute | ||
* `state` - State of the app compute. | ||
* `message` - Compute status message | ||
* `app_status` attribute | ||
* `state` - State of the application. | ||
* `message` - Application status message | ||
* `url` - The URL of the app once it is deployed. | ||
* `create_time` - The creation time of the app. | ||
* `creator` - The email of the user that created the app. | ||
* `update_time` - The update time of the app. | ||
* `updater` - The email of the user that last updated the app. | ||
* `service_principal_id` - id of the app service principal | ||
* `service_principal_name` - name of the app service principal | ||
* `default_source_code_path` - The default workspace file system path of the source code from which app deployment are created. This field tracks the workspace source code path of the last active deployment. | ||
|
||
### resources Attribute | ||
|
||
This attribute describes a resource used by the app. | ||
|
||
* `name` - The name of the resource. | ||
* `description` - The description of the resource. | ||
|
||
Exactly one of the following attributes will be provided: | ||
|
||
* `secret` attribute | ||
* `scope` - Scope of the secret to grant permission on. | ||
* `key` - Key of the secret to grant permission on. | ||
* `permission` - Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: `READ`, `WRITE`, `MANAGE`. | ||
* `sql_warehouse` attribute | ||
* `id` - Id of the SQL warehouse to grant permission on. | ||
* `permission` - Permission to grant on the SQL warehouse. Supported permissions are: `CAN_MANAGE`, `CAN_USE`, `IS_OWNER`. | ||
* `serving_endpoint` attribute | ||
* `name` - Name of the serving endpoint to grant permission on. | ||
* `permission` - Permission to grant on the serving endpoint. Supported permissions are: `CAN_MANAGE`, `CAN_QUERY`, `CAN_VIEW`. | ||
* `job` attribute | ||
* `id` - Id of the job to grant permission on. | ||
* `permission` - Permissions to grant on the Job. Supported permissions are: `CAN_MANAGE`, `IS_OWNER`, `CAN_MANAGE_RUN`, `CAN_VIEW`. | ||
|
||
## Related Resources | ||
|
||
The following resources are used in the same context: | ||
|
||
* [databricks_app](../resources/app.md) to manage [Databricks Apps](https://docs.databricks.com/en/dev-tools/databricks-apps/index.html). | ||
* [databricks_sql_endpoint](sql_endpoint.md) to manage Databricks SQL [Endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html). | ||
* [databricks_model_serving](model_serving.md) to serve this model on a Databricks serving endpoint. | ||
* [databricks_secret](secret.md) to manage [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace. | ||
* [databricks_job](job.md) to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
subcategory: "Apps" | ||
--- | ||
# databricks_app Resource | ||
|
||
-> This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html). | ||
|
||
[Databricks Apps](https://docs.databricks.com/en/dev-tools/databricks-apps/index.html) run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on. This resource creates the application but does not handle app deployment, which should be handled separately as part of your CI/CD pipeline. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "databricks_app" "this" { | ||
name = "my-custom-app" | ||
description = "My app" | ||
resources = [{ | ||
name = "sql-warehouse" | ||
sql_warehouse = { | ||
id = "e9ca293f79a74b5c" | ||
permission = "CAN_MANAGE" | ||
} | ||
}, | ||
{ | ||
name = "serving-endpoint" | ||
serving_endpoint = { | ||
name = "databricks-meta-llama-3-1-70b-instruct" | ||
permission = "CAN_MANAGE" | ||
} | ||
}, | ||
{ | ||
name = "job" | ||
job = { | ||
id = "1234" | ||
permission = "CAN_MANAGE" | ||
} | ||
}] | ||
} | ||
nkvuong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are required: | ||
|
||
* `name` - (Required) The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. It must be unique within the workspace. | ||
* `description` - (Optional) The description of the app. | ||
* `resources` - (Optional) A list of resources that the app have access to. | ||
|
||
### resources Configuration Attribute | ||
|
||
This attribute describes a resource used by the app. | ||
|
||
* `name` - (Required) The name of the resource. | ||
* `description` - (Optional) The description of the resource. | ||
|
||
Exactly one of the following attributes must be provided: | ||
|
||
* `secret` attribute | ||
* `scope` - Scope of the secret to grant permission on. | ||
* `key` - Key of the secret to grant permission on. | ||
* `permission` - Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: `READ`, `WRITE`, `MANAGE`. | ||
* `sql_warehouse` attribute | ||
* `id` - Id of the SQL warehouse to grant permission on. | ||
* `permission` - Permission to grant on the SQL warehouse. Supported permissions are: `CAN_MANAGE`, `CAN_USE`, `IS_OWNER`. | ||
* `serving_endpoint` attribute | ||
* `name` - Name of the serving endpoint to grant permission on. | ||
* `permission` - Permission to grant on the serving endpoint. Supported permissions are: `CAN_MANAGE`, `CAN_QUERY`, `CAN_VIEW`. | ||
* `job` attribute | ||
* `id` - Id of the job to grant permission on. | ||
* `permission` - Permissions to grant on the Job. Supported permissions are: `CAN_MANAGE`, `IS_OWNER`, `CAN_MANAGE_RUN`, `CAN_VIEW`. | ||
|
||
## Attribute Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `compute_status` attribute | ||
* `state` - State of the app compute. | ||
* `message` - Compute status message | ||
* `app_status` attribute | ||
* `state` - State of the application. | ||
* `message` - Application status message | ||
* `url` - The URL of the app once it is deployed. | ||
* `create_time` - The creation time of the app. | ||
* `creator` - The email of the user that created the app. | ||
* `update_time` - The update time of the app. | ||
* `updater` - The email of the user that last updated the app. | ||
* `service_principal_id` - id of the app service principal | ||
* `service_principal_name` - name of the app service principal | ||
* `default_source_code_path` - The default workspace file system path of the source code from which app deployment are created. This field tracks the workspace source code path of the last active deployment. | ||
|
||
## Import | ||
|
||
This resource can be imported by name: | ||
|
||
```hcl | ||
import { | ||
to = databricks_app.this | ||
id = "<app_name>" | ||
} | ||
``` | ||
|
||
or using the `terraform` CLI: | ||
|
||
```bash | ||
terraform import databricks_app.this <app_name> | ||
``` | ||
|
||
## Related Resources | ||
|
||
The following resources are used in the same context: | ||
|
||
* [databricks_sql_endpoint](sql_endpoint.md) to manage Databricks SQL [Endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html). | ||
* [databricks_model_serving](model_serving.md) to serve this model on a Databricks serving endpoint. | ||
* [databricks_secret](secret.md) to manage [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace. | ||
* [databricks_job](job.md) to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having resources as array isn't really nice IMHO - individual
resource
blocks are easier to use