Giter VIP home page Giter VIP logo

terraform-provider-confluent-schema-registry's People

Contributors

arkiaconsulting avatar noureddineseddik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-provider-confluent-schema-registry's Issues

context deadline exceeded

image

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.

Add support for darwin_arm64

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.

Support for PROTOBUF

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?

Support for schema references

Description of the problem

Confluent introduced support for schema references which are pretty handy when you want to store multiple event types in a single topic.

Proposed solution

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.

checking if schema has been actually registered as latest version

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.

Support for DataSource in a given schema version

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

  • switch the data source version field from computed to optional
  • load a specific version when that field is set, else keep existing logic (fetch latest)

The resource implementation remains unchanged and always handles the latest available version in the registry.

Example

  1. Declare an event schema and a topic's one with reference as usual
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
  }
}
  1. Event schema evolves, topic now refers to v1 event schema with dataSource
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
  }
}

Username and Password are optional but provider fails if not specified or blank

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:
Screenshot 2021-06-16 at 10 10 48

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}")
}

Modify schemas outside of terraform and provider recognizing diff

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.