Skip to content

Commit

Permalink
Merge pull request #18 from mineiros-io/mariux/fix-schema
Browse files Browse the repository at this point in the history
fix: Schema support
  • Loading branch information
mariux authored May 15, 2023
2 parents 36426bc + eab0a6f commit 1622ae0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.1]

### Fixed

- Fix support for schema definitions

## [0.1.0]

### Added
Expand Down Expand Up @@ -44,7 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add support for [`mineiros-io/terraform-google-pubsub-topic-iam` Terraform Module](https://github.com/mineiros-io/terraform-google-pubsub-topic-iam)
- Add support for [`mineiros-io/terraform-google-pubsub-subscription` Terraform Module](https://github.com/mineiros-io/terraform-google-pubsub-subscription)

[unreleased]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.1.0...HEAD
[unreleased]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.1.1...HEAD
[0.1.1]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.0.4...v0.1.0
[0.0.4]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.0.3...v0.0.4
[0.0.3]: https://github.com/mineiros-io/terraform-google-pubsub-topic/compare/v0.0.2...v0.0.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ See [variables.tf] and [examples/] for details and use-cases.
type = "int"
}
]
}
})
}
```

Expand Down
2 changes: 1 addition & 1 deletion README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ section {
type = "int"
}
]
}
})
}
END

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "google_pubsub_topic" "topic" {
}

resource "google_pubsub_schema" "schema" {
for_each = can(var.schema.name) ? { var.schema.name = var.schema } : {}
for_each = can(var.schema.name) ? { (var.schema.name) = var.schema } : {}

project = var.project

Expand Down
20 changes: 20 additions & 0 deletions test/unit-complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ module "test" {
"us-west1",
]

schema = {
name = "example"
type = "AVRO"
encoding = "JSON"
definition = jsonencode({
type = "record"
name = "Avro"
fields = [
{
name = "StringField"
type = "string"
},
{
name = "IntField"
type = "int"
}
]
})
}

subscriptions = [
{
name = "test-name"
Expand Down

0 comments on commit 1622ae0

Please sign in to comment.