Skip to content
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

[ISSUE] Service Principal Application_id parameter #656

Closed
roleaw opened this issue May 19, 2021 · 2 comments · Fixed by #677
Closed

[ISSUE] Service Principal Application_id parameter #656

roleaw opened this issue May 19, 2021 · 2 comments · Fixed by #677

Comments

@roleaw
Copy link

roleaw commented May 19, 2021

Hi there,

Thank you for opening an issue. Please note that we try to keep the Databricks Provider issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

0.14.7

Affected Resource(s)

  • databricks_service_principal

Environment variable names

To get relevant environment variable names please copypaste the output of the following command:
$ env | sort | grep -E 'DATABRICKS|AWS|AZURE|ARM|TEST' | awk -F= '{print $1}'

AWS_CA_BUNDLE
AWS_DEFAULT_PROFILE
AWS_EXECUTION_ENV
AWS_FED_PASSWORD
AWS_FED_ROLENAME
AWS_FED_USERNAME
AWS_XRAY_CONTEXT_MISSING
_AWS_XRAY_DAEMON_ADDRESS
AWS_XRAY_DAEMON_ADDRESS
_AWS_XRAY_DAEMON_PORT
DATABRICKS_HOST
DATABRICKS_TOKEN

Terraform Configuration Files

terraform {
  backend "s3" {
  }

  required_providers {
    databricks = {
      source  = "databrickslabs/databricks"
      version = "0.3.4"
    }
  }
}
provider "databricks" {
  host     = data.aws_ssm_parameter.host.value
  token    = data.aws_ssm_parameter.token.value
  username = ""
  password = ""
}

Run command:
tfenv terragrunt apply ${TFTG_CLI_ARGS_APPLY_MODULE}

Debug Output

Debug logs in attached file

Expected Behavior

Service principal is created when using the sample resource from the documentation here:
https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs/resources/service_principal

resource "databricks_service_principal" "sp" {
  application_id = "00000000-0000-0000-0000-000000000000"
}

Should create a service principal.

Terraform plan output:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.test_policy2.databricks_service_principal.sp will be created
  + resource "databricks_service_principal" "sp" {
      + active         = true
      + application_id = "00000000-0000-0000-0000-000000000000"
      + display_name   = (known after apply)
      + id             = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
[teams-deploy-debug.txt](https://github.com/databrickslabs/terraform-provider-databricks/files/6511667/teams-deploy-debug.txt)

Actual Behavior

If a string value is provided for application_id, it throws the error:

Error: Request is unparsable, syntactically incorrect, or violates schema.

  on base-cluster-policy-new/instance-profile.tf line 219, in resource "databricks_service_principal" "sp":
 219: resource "databricks_service_principal" "sp" {

If application_id is left empty, it fails with this error:

Error: Missing required argument

  on base-cluster-policy-new/instance-profile.tf line 219, in resource "databricks_service_principal" "sp":
 219: resource "databricks_service_principal" "sp" {

The argument "application_id" is required, but no definition was found.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Define resources as described above and in the documentation.
  2. terraform apply

Important Factoids

N/a

@roleaw
Copy link
Author

roleaw commented May 19, 2021

Debug logs:
teams-deploy-debug.txt

@roleaw roleaw changed the title [ISSUE] Provider bug [ISSUE] Service Principal Application_id parameter May 20, 2021
@roleaw
Copy link
Author

roleaw commented May 25, 2021

Converting this into a feature request. I found this closed issue that states that the service principal is only available for Azure.

#630

We'd like to request it for AWS as well.

@nfx nfx linked a pull request Jun 2, 2021 that will close this issue
@nfx nfx closed this as completed in #677 Jun 2, 2021
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant