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

Terraform provider does not work well when deploying a Flink Model/Statement that uses sql.secrets.* #397

Open
novarz opened this issue Jun 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@novarz
Copy link

novarz commented Jun 24, 2024

TF tries to redeploy the resource even when nothing has changed with the consequent failure.

image

@novarz
Copy link
Author

novarz commented Jun 24, 2024

Here is the TF

# --------------------------------------------------------
# Flink SQL: CREATE Model vector_encoding
# --------------------------------------------------------
resource “confluent_flink_statement” “create_model” {
  depends_on = [
        resource.confluent_environment.environment,
        resource.confluent_schema_registry_cluster.essentials,
        resource.confluent_kafka_cluster.cluster,
        resource.confluent_connector.datagen_products,
        resource.[confluent_flink_compute_pool.my](http://confluent_flink_compute_pool.my/)_compute_pool,
        resource.confluent_role_binding.app-general-environment-admin
  ]
  organization {
    id = data.confluent_organization.main.id
  }
   environment {
    id = confluent_environment.environment.id
  }
  compute_pool {
    id = [confluent_flink_compute_pool.my](http://confluent_flink_compute_pool.my/)_compute_pool.id
  }
  principal {
    id = confluent_service_account.app-general.id
  }
   properties = {
    “sql.current-catalog”   : confluent_environment.environment.display_name
    “sql.current-database”  : confluent_kafka_cluster.cluster.display_name
    “sql.secrets.openaikey” : var.openai_key
  }
  statement  = “CREATE MODEL `vector_encoding` INPUT (input STRING) OUTPUT (vector ARRAY<FLOAT>) WITH( ‘TASK’ = ‘classification’,‘PROVIDER’ = ‘OPENAI’,‘OPENAI.ENDPOINT’ = ‘https://api.openai.com/v1/embeddings','OPENAI.API_KEY’ = ‘{{sessionconfig/sql.secrets.openaikey}}’);”
  rest_endpoint   =  data.[confluent_flink_region.my](http://confluent_flink_region.my/)_flink_region.rest_endpoint
  credentials {
    key    = [confluent_api_key.my](http://confluent_api_key.my/)_flink_api_key.id
    secret = [confluent_api_key.my](http://confluent_api_key.my/)_flink_api_key.secret
  }
  lifecycle {
    prevent_destroy = false
  }
}

@linouk23 linouk23 added the bug Something isn't working label Jul 2, 2024
@linouk23
Copy link
Collaborator

linouk23 commented Jul 11, 2024

Thank you for creating this issue @novarz! It does seem like a bug to me, we'll take a look at it soon 👍

@ConfluentSpencer
Copy link
Contributor

@tmalikconfluent can you take a look at this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants