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 · 1 comment

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_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_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) 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_flink_region.rest_endpoint
credentials {
key = confluent_api_key.my_flink_api_key.id
secret = confluent_api_key.my_flink_api_key.secret
}
lifecycle {
prevent_destroy = false
}
}

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

No branches or pull requests

1 participant