Skip to content

Commit

Permalink
fix(rules): add AWS Kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Oct 13, 2023
1 parent 549b566 commit c713d8b
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ exports[`all > should match everything 1`] = `
"aws.fargate",
"aws.glacier",
"aws.glue",
"aws.kafka",
"aws.kinesis",
"aws.kms",
"aws.lambda",
Expand Down
10 changes: 10 additions & 0 deletions src/rules/messaging/apache_kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ register({
type: 'db',
dependencies: [
{ type: 'docker', name: 'bitnami/kafka' },
{ type: 'docker', name: 'ubuntu/kafka' },
{ type: 'docker', name: 'bitnamicharts/kafka' },
{ type: 'terraform', name: 'registry.terraform.io/confluentinc/confluent' },
{ type: 'php', name: 'nmred/kafka-php' },
{ type: 'php', name: 'longlang/phpkafka' },
{ type: 'npm', name: 'kafkajs' },
{ type: 'npm', name: 'kafka-node' },
{ type: 'npm', name: 'kafkajs-snappy' },
{ type: 'npm', name: 'opentelemetry-instrumentation-kafkajs' },
{ type: 'ruby', name: 'ruby-kafka' },
{ type: 'ruby', name: 'fluent-plugin-kafka' },
{ type: 'ruby', name: 'logstash-output-kafka' },
{ type: 'ruby', name: 'logstash-input-kafka' },
],
});
13 changes: 13 additions & 0 deletions src/rules/messaging/aws.kafka.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { register } from '../../register.js';

register({
tech: 'aws.kafka',
name: 'AWS Kafka',
type: 'db',
dependencies: [
{ type: 'ruby', name: 'aws-sdk-kafka' },
{ type: 'terraform.resource', name: 'aws_msk_cluster' },
{ type: 'terraform.resource', name: 'aws_msk_configuration' },
{ type: 'terraform.resource', name: 'aws_mskconnect_connector' },
],
});
1 change: 1 addition & 0 deletions src/rules/messaging/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './apache_kafka.js';
import './aws.kafka.js';
import './aws.mq.js';
import './aws.sns.js';
import './aws.sqs.js';
Expand Down
10 changes: 10 additions & 0 deletions src/rules/spec/docker/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ exports[`docker > should match everything 2`] = `
"bitnami/supabase-storage",
"0.0.0",
],
[
"docker",
"bitnamicharts/kafka",
"0.0.0",
],
[
"docker",
"bitnamicharts/postgresql",
Expand Down Expand Up @@ -525,6 +530,11 @@ exports[`docker > should match everything 2`] = `
"typesense/typesense",
"0.0.0",
],
[
"docker",
"ubuntu/kafka",
"0.0.0",
],
[
"docker",
"ubuntu/postgres",
Expand Down
21 changes: 21 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`npm > should match everything 1`] = `
"alpinejs",
"amplitude",
"angular",
"apache_kafka",
"apiplatform",
"auth0",
"aws",
Expand Down Expand Up @@ -1685,6 +1686,21 @@ exports[`npm > should match everything 2`] = `
"jsforce",
"0.0.0",
],
[
"npm",
"kafka-node",
"0.0.0",
],
[
"npm",
"kafkajs",
"0.0.0",
],
[
"npm",
"kafkajs-snappy",
"0.0.0",
],
[
"npm",
"koa",
Expand Down Expand Up @@ -1850,6 +1866,11 @@ exports[`npm > should match everything 2`] = `
"openai",
"0.0.0",
],
[
"npm",
"opentelemetry-instrumentation-kafkajs",
"0.0.0",
],
[
"npm",
"paypal-rest-sdk",
Expand Down
27 changes: 27 additions & 0 deletions src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`ruby (component) > should match everything 1`] = `
[
"adyen",
"algolia",
"apache_kafka",
"auth0",
"aws",
"aws.apigateway",
Expand All @@ -24,6 +25,7 @@ exports[`ruby (component) > should match everything 1`] = `
"aws.elasticache",
"aws.glacier",
"aws.glue",
"aws.kafka",
"aws.kinesis",
"aws.kms",
"aws.lambda",
Expand Down Expand Up @@ -289,6 +291,11 @@ exports[`ruby (component) > should match everything 2`] = `
"aws-sdk-glue",
"1.0.0",
],
[
"ruby",
"aws-sdk-kafka",
"1.0.0",
],
[
"ruby",
"aws-sdk-kinesis",
Expand Down Expand Up @@ -509,6 +516,11 @@ exports[`ruby (component) > should match everything 2`] = `
"fastly",
"1.0.0",
],
[
"ruby",
"fluent-plugin-kafka",
"1.0.0",
],
[
"ruby",
"functions_framework ",
Expand Down Expand Up @@ -719,11 +731,21 @@ exports[`ruby (component) > should match everything 2`] = `
"logstash-filter-translate",
"1.0.0",
],
[
"ruby",
"logstash-input-kafka",
"1.0.0",
],
[
"ruby",
"logstash-logger",
"1.0.0",
],
[
"ruby",
"logstash-output-kafka",
"1.0.0",
],
[
"ruby",
"logstash-output-sqs",
Expand Down Expand Up @@ -884,6 +906,11 @@ exports[`ruby (component) > should match everything 2`] = `
"rollbar",
"1.0.0",
],
[
"ruby",
"ruby-kafka",
"1.0.0",
],
[
"ruby",
"ruby-mysql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"aws.elasticache",
"aws.glacier",
"aws.glue",
"aws.kafka",
"aws.kinesis",
"aws.kms",
"aws.lambda",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export type AllowedKeys =
| 'aws.fargate'
| 'aws.glacier'
| 'aws.glue'
| 'aws.kafka'
| 'aws.kinesis'
| 'aws.kms'
| 'aws.lambda'
Expand Down

0 comments on commit c713d8b

Please sign in to comment.