Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonrls/js-terraform-kafka-diagram
Library for building a datagram using the config for kafka
https://github.com/antonrls/js-terraform-kafka-diagram
Last synced: 23 days ago
JSON representation
Library for building a datagram using the config for kafka
- Host: GitHub
- URL: https://github.com/antonrls/js-terraform-kafka-diagram
- Owner: AntonRls
- Created: 2024-08-16T13:26:20.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T15:06:26.000Z (4 months ago)
- Last Synced: 2024-08-21T13:05:56.416Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-terraform-kafka-diagram
Library for building a diagram using the terraform-config for kafka
## Usage
```npm
npm install [email protected]
npx terraform-kafka-diagram
```## Example
kafka.tf
```
locals {
kafka_users = [
"first-service",
"second-service",
"super-service",
"other-system"
]kafka_topics = {
"first-service.main-topic" = {
user_roles = {
first-service = ["ACCESS_ROLE_PRODUCER"]
second-service = ["ACCESS_ROLE_CONSUMER"]
}
},
"second-service.alpha-topic" = {
user_roles = {
second-service = ["ACCESS_ROLE_PRODUCER"]
other-system = ["ACCESS_ROLE_PRODUCER, ACCESS_ROLE_CONSUMER"]
}
},
"second-service.beta-topic" = {
user_roles = {
second-service = ["ACCESS_ROLE_PRODUCER"]
other-system = ["ACCESS_ROLE_CONSUMER"]
}
},
"second-service.gamma-topic" = {
user_roles = {
second-service = ["ACCESS_ROLE_PRODUCER"]
other-system = ["ACCESS_ROLE_CONSUMER"]
}
},
"second-service.delta-topic" = {
user_roles = {
second-service = ["ACCESS_ROLE_PRODUCER"]
other-system = ["ACCESS_ROLE_CONSUMER"]
}
},
"super-service.big-topic" = {
user_roles = {
first-service = ["ACCESS_ROLE_PRODUCER"]
second-service = ["ACCESS_ROLE_PRODUCER"]
other-system = ["ACCESS_ROLE_PRODUCER"]
super-service = ["ACCESS_ROLE_CONSUMER"]
}
}
}
}
``````npm
npx terraform-kafka-diagram kafka.tf result.md
```Result:
```mermaid
flowchart LRsubgraph First Service
first-service([first-service])
first-service.main-topic[first-service.main-topic]
endsubgraph Second Service
second-service([second-service])
second-service.alpha-topic[second-service.alpha-topic]
second-service.beta-topic[second-service.beta-topic]
second-service.gamma-topic[second-service.gamma-topic]
second-service.delta-topic[second-service.delta-topic]
endsubgraph Super Service
super-service([super-service])
super-service.big-topic[super-service.big-topic]
endother-system([other-system])
first-service -->|Produce| first-service.main-topic
first-service.main-topic -->|Consume| second-service
second-service -->|Produce| second-service.alpha-topic
other-system -->|Produce| second-service.alpha-topic
second-service.alpha-topic -->|Consume| other-system
second-service -->|Produce| second-service.beta-topic
second-service.beta-topic -->|Consume| other-system
second-service -->|Produce| second-service.gamma-topic
second-service.gamma-topic -->|Consume| other-system
second-service -->|Produce| second-service.delta-topic
second-service.delta-topic -->|Consume| other-system
first-service -->|Produce| super-service.big-topic
second-service -->|Produce| super-service.big-topic
other-system -->|Produce| super-service.big-topic
super-service.big-topic -->|Consume| super-service
```