Skip to content

Commit

Permalink
Examples with schema references support
Browse files Browse the repository at this point in the history
  • Loading branch information
noureddineseddik authored and arkiaconsulting committed Jul 28, 2021
1 parent eae17c3 commit 5a4e4d1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
schemaregistry = {
version = "0.4"
version = "0.6"
source = "github.com/arkiaconsulting/schemaregistry"
}
}
Expand All @@ -16,8 +16,19 @@ resource "schemaregistry_schema" "user_added" {
schema = file("./userAdded.avsc")
}

resource "schemaregistry_schema" "with_reference" {
subject = "with-reference"
schema = "[\"akc.test.userAdded\"]"

references {
name = "akc.test.userAdded"
subject = schemaregistry_schema.user_added.subject
version = schemaregistry_schema.user_added.version
}
}

data "schemaregistry_schema" "main" {
subject = schemaregistry_schema.user_added.subject
subject = schemaregistry_schema.with_reference.subject
}

output "schema_id" {
Expand All @@ -35,3 +46,7 @@ output "schema_string" {
output "schema_schema_id" {
value = data.schemaregistry_schema.main.schema_id
}

output "schema_references" {
value = data.schemaregistry_schema.main.references
}

0 comments on commit 5a4e4d1

Please sign in to comment.