diff --git a/docs/resources/custom_app_integration.md b/docs/resources/custom_app_integration.md new file mode 100644 index 0000000000..30700359e8 --- /dev/null +++ b/docs/resources/custom_app_integration.md @@ -0,0 +1,57 @@ +--- +subcategory: "Apps" +--- +# databricks_custom_app_integration Resource + +-> Initialize provider with `alias = "account"`, and `host` pointing to the account URL, like, `host = "https://accounts.cloud.databricks.com"`. Use `provider = databricks.account` for all account-level resources. + +This resource allows you to enable [custom OAuth applications](https://docs.databricks.com/en/integrations/enable-disable-oauth.html#enable-custom-oauth-applications-using-the-databricks-ui). + +## Example Usage + +```hcl +resource "databricks_custom_app_integration" "this" { + name = "custom_integration_name" + redirect_urls = ["https://example.com"] + scopes = ["all-apis"] + token_access_policy { + access_token_ttl_in_minutes = %s + refresh_token_ttl_in_minutes = 30 + } +} +``` + +## Argument Reference + +The following arguments are available: + +* `name` - (Required) Name of the custom OAuth app. Change requires a new resource +* `confidential` - Indicates whether an OAuth client secret is required to authenticate this client. Default to `false` +* `redirect_urls` - List of OAuth redirect urls + +### token_access_policy Configuration Block (Optional) + +* `access_token_ttl_in_minutes` - access token time to live in minutes +* `refresh_token_ttl_in_minutes` - refresh token time to live in minutes + +## Attribute Reference + +In addition to all arguments above, the following attributes are exported: + +* `integration_id` - Unique integration id for the custom OAuth app. +* `client_id` - OAuth client-id generated by Databricks +* `client_secret` - OAuth client-secret generated by the Databricks if this is a confidential OAuth app. + +## Import + +This resource can be imported by Databricks account ID and integration ID. + +```sh +terraform import databricks_budget.this '|' +``` + +## Related Resources + +The following resources are used in the context: + +* [databricks_mws_workspaces](mws_workspaces.md) to set up Databricks workspaces. diff --git a/internal/acceptance/custom_app_integraiton_test.go b/internal/acceptance/custom_app_integration_test.go similarity index 96% rename from internal/acceptance/custom_app_integraiton_test.go rename to internal/acceptance/custom_app_integration_test.go index dc8d880b6d..98df8c12c9 100644 --- a/internal/acceptance/custom_app_integraiton_test.go +++ b/internal/acceptance/custom_app_integration_test.go @@ -9,7 +9,7 @@ var ( customAppIntegrationTemplate = `resource "databricks_custom_app_integration" "this" { name = "custom_integration_name" redirect_urls = ["https://example.com"] - scopes = ["all"] + scopes = ["all-apis"] token_access_policy { access_token_ttl_in_minutes = %s refresh_token_ttl_in_minutes = 30