arkiaconsulting / terraform-provider-confluent-schema-registry Goto Github PK
View Code? Open in Web Editor NEWA terraform provider for managing schemas in a Confluent schema registry
License: MIT License
A terraform provider for managing schemas in a Confluent schema registry
License: MIT License
Guys, I am getting this error while using this provider inside a gitlab pipeline, kindly let me know if I am missing something here. Its failing while creating the schema. I am able to use the official confluent tf provider without any issues for creating topics, clusters etc., in the same pipeline but since they haven't implemented the features to manage schema I thought of using this provider now. Would appreciate some insight to this.
Would it be possible to add support for Apple's M1 chips.
Provider registry.terraform.io/arkiaconsulting/confluent-schema-registry v0.8.0 does not have a package available for your current platform, darwin_arm64.
We're trying to automate the creation of our confluent schema registry and this provider look really good, however our schema is using PROTOBUF.
Would it be possible to extend the functionality of the schemaregistry_schema resource to support PROTOBUF as well as AVRO?
Confluent introduced support for schema references which are pretty handy when you want to store multiple event types in a single topic.
We would like to contribute with MR and implement the following changes :
resource "schemaregistry_schema" "a" {
schema = ".."
subject = "..."
}
resource "schemaregistry_schema" "b" {
schema = ".."
subject = "..."
reference {
name = "..."
subject = schemaregistry_schema.a.subject
version = schemaregistry_schema.a.version
}
}
Given the schema a
is updated, the schema b
version should be updated and its reference to schema a
version also.
If one wants to stick with a version he can just hardcode it in the reference
block
We will need to update https://github.com/riferrei/srclient from 0.3.0
to 0.3.1
.
We are open to contrib with a MR if this changes fits in your plan.
Schema registry doesn't register given schema for subject if the schema has already been register for the subject in any of historical versions. In this resource schemaregistry_schema doesn't register the schema for subject but reports that apply has been successful. Would be great to implemented checking if registered schema is in the latest version for given subject and report an error if not.
Description of the problem
Existing dataSource
implementation always sticks to the latest
available version of the registry's schema.
An older version of a schema could still be in use (e.g.: in a topic with references).
Proposed solution
computed
to optional
latest
)The resource
implementation remains unchanged and always handles the latest
available version in the registry.
Example
resource "schemaregistry_schema" "user_added" {
subject = "MyTopic-akc.test.userAdded-value"
schema = file("./userAdded.avsc")
}
resource "schemaregistry_schema" "with_reference" {
subject = "with-reference"
schema = "[\"akc.test.userAdded\"]"
reference {
name = "akc.test.userAdded"
subject = schemaregistry_schema.user_added.subject
version = schemaregistry_schema.user_added.version
}
}
resource "schemaregistry_schema" "user_added" {
subject = "MyTopic-akc.test.userAdded-value"
schema = file("./userAdded_v2.avsc")
}
data "schemaregistry_schema" "user_added_v1" {
subject = "MyTopic-akc.test.userAdded-value"
version = 1
}
resource "schemaregistry_schema" "with_reference" {
subject = "with-reference"
schema = "[\"akc.test.userAdded\"]"
reference {
name = "akc.test.userAdded"
subject = data.schemaregistry_schema.user_added_v1.subject
version = data.schemaregistry_schema.user_added_v1.version
}
}
Running the confluent platform in a local k8s with no username and password. I set the schema url to point to a k8s node port without specifying the username and password in the provider but get the following error:
Terraform looks as follows:
terraform {
required_providers {
schemaregistry = {
source = "arkiaconsulting/confluent-schema-registry"
}
}
}
provider "schemaregistry" {
schema_registry_url = "http://localhost:30881"
}
resource "schemaregistry_schema" "main" {
for_each = toset(["test.avro","test2.avro"])
subject = each.value
schema = file("${path.module}/files/${each.value}")
}
Currently this provider works well for avro schemas that I only modify via terraform.
But if I make modifications outside of terraform it doesn't recognize them.
For example I created a new schema via the kafka api and it said there were no changes made:
Acquiring state lock. This may take a few moments...
schemaregistry_schema.heartbeat_v1: Refreshing state... [id=heartbeat_v1]
No changes. Your infrastructure matches the configuration.
I also deleted my existing schema via the kafka api and instead of trying to create a new one it gives me this error:
Acquiring state lock. This may take a few moments...
schemaregistry_schema.heartbeat_v1: Refreshing state... [id=heartbeat_v1]
╷
│ Error: 404 Not Found: Subject 'heartbeat_v1' not found. io.confluent.rest.exceptions.RestNotFoundException: Subject 'heartbeat_v1' not found.
│ io.confluent.rest.exceptions.RestNotFoundException: Subject 'heartbeat_v1' not found.
│ at io.confluent.kafka.schemaregistry.rest.exceptions.Errors.subjectNotFoundException(Errors.java:77)
│ at io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource.getSchemaByVersion(SubjectVersionsResource.java:141)
│ at jdk.internal.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
│ at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
│ at java.base/java.lang.reflect.Method.invoke(Method.java:566)
│ at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.